aim4.vehicle

## Class BasicVehicle.NonAccelMovement

- java.lang.Object
- - aim4.vehicle.BasicVehicle.NonAccelMovement

- All Implemented Interfaces:
    BasicVehicle.Movement
  Direct Known Subclasses:
    BasicVehicle.SteeringMovement, BasicVehicle.TrackMovement
  Enclosing class:
    BasicVehicle

      public abstract static class BasicVehicle.NonAccelMovement
      extends Object
      implements BasicVehicle.Movement

  The non-acceleration movement

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `heading` The direction of the vehicle
    `protected Point2D` | `position` The position of the vehicle, represented by the point at the center of the front of the Vehicle.
    `protected VehicleSpec` | `spec` The specification of the vehicle
    `protected double` | `velocity` The velocity of the vehicle

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicVehicle.NonAccelMovement(VehicleSpec spec, Point2D position, double heading, double velocity)` Create a non-acceleration movement.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getHeading()` Get the heading of the vehicle
    `Point2D` | `getPosition()` Get the position of the vehicle.
    `VehicleSpec` | `getVehicleSpec()` Get the vehicle specification.
    `double` | `getVelocity()` Get the velocity of the vehicle
    `protected void` | `setVelocityWithBound(double velocity)` Set the velocity with respect to the physical limit of the vehicle.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface aim4.vehicle.BasicVehicle.Movement

      `move`

- - ### Field Detail

    - #### spec

          protected final VehicleSpec spec

      The specification of the vehicle

    - #### position

          protected Point2D position

      The position of the vehicle, represented by the point at the center of the front of the Vehicle.

    - #### heading

          protected double heading

      The direction of the vehicle

    - #### velocity

          protected double velocity

      The velocity of the vehicle

  - ### Constructor Detail

    - #### BasicVehicle.NonAccelMovement

          public BasicVehicle.NonAccelMovement(VehicleSpec spec,
                                       Point2D position,
                                       double heading,
                                       double velocity)

      Create a non-acceleration movement.
      Parameters:
        `spec` - the specification of the vehicle
        `position` - the position
        `heading` - the heading
        `velocity` - the velocity

  - ### Method Detail

    - #### getVehicleSpec

          public final VehicleSpec getVehicleSpec()

      Get the vehicle specification.
      Returns:
        the vehicle specification

    - #### getPosition

          public Point2D getPosition()

      Get the position of the vehicle.
      Specified by:
        `getPosition` in interface `BasicVehicle.Movement`
      Returns:
        the position of the vehicle

    - #### getHeading

          public double getHeading()

      Get the heading of the vehicle
      Specified by:
        `getHeading` in interface `BasicVehicle.Movement`
      Returns:
        the heading of the vehicle

    - #### getVelocity

          public double getVelocity()

      Get the velocity of the vehicle
      Specified by:
        `getVelocity` in interface `BasicVehicle.Movement`
      Returns:
        the velocity of the vehicle

    - #### setVelocityWithBound

          protected void setVelocityWithBound(double velocity)

      Set the velocity with respect to the physical limit of the vehicle.
      Parameters:
        `velocity` - the velocity

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2013. All rights reserved.