jasi.sim.geo.cartesian
Class SpeedVec

java.lang.Object
  extended by jasi.sim.geo.GeoObject
      extended by jasi.sim.geo.cartesian.SpeedVec
All Implemented Interfaces:
SimValue, Geometric, java.io.Serializable

public final class SpeedVec
extends GeoObject

Immutable class to represent a speed vector.

See Also:
Serialized Form

Field Summary
static java.util.Comparator<SpeedVec> COMPARATOR
          The value comparator of speed vectors.
static SpeedVec FIXED
          Non-moving speed vector, fixed.
 
Fields inherited from interface jasi.sim.geo.Geometric
BEGIN, END, MIDLE
 
Constructor Summary
SpeedVec(Speed x, Speed y)
          Constructor of a speed vector, with vanishing third component.
SpeedVec(Speed x, Speed y, Speed z)
          Constructor of a speed vector.
SpeedVec(SpeedVec s)
          Constructor of a speed vector.
SpeedVec(java.lang.String s)
          Constructor of a speed vector.
 
Method Summary
 Speed abs()
          Retrieve the absolut speed value of this speed vector.
 SpeedVec add(SpeedVec p)
          Add that speed vector to this speed vector.
 Speed[] components()
          Get the components of this space vector.
 Direction direction()
          Retrieve unit direction of this speed vector.
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
 SpeedVec minus(SpeedVec p)
          Substract that speed vector from this speed vector.
 SpeedVec times(double f)
          Multiply this speed vector by a factor.
 SpaceVec times(Time time)
          Calculate the space vector distance which is achieved by this speed vector in a given time.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class jasi.sim.geo.GeoObject
getContent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPARATOR

public static final java.util.Comparator<SpeedVec> COMPARATOR
The value comparator of speed vectors. A comparison function, which imposes a total ordering.


FIXED

public static final SpeedVec FIXED
Non-moving speed vector, fixed.

Constructor Detail

SpeedVec

public SpeedVec(Speed x,
                Speed y,
                Speed z)
Constructor of a speed vector.

Parameters:
x - First component.
y - Second component.
z - Third component.

SpeedVec

public SpeedVec(SpeedVec s)
Constructor of a speed vector.

Parameters:
s - A speed vector.

SpeedVec

public SpeedVec(Speed x,
                Speed y)
Constructor of a speed vector, with vanishing third component.

Parameters:
x - First component.
y - Second component.

SpeedVec

public SpeedVec(java.lang.String s)
Constructor of a speed vector.

Parameters:
s - The string representation of a speed vector object.
Method Detail

times

public SpaceVec times(Time time)
Calculate the space vector distance which is achieved by this speed vector in a given time.

Parameters:
time - The time.
Returns:
The distance.

abs

public Speed abs()
Retrieve the absolut speed value of this speed vector.

Returns:
The absolute speed value.

direction

public Direction direction()
Retrieve unit direction of this speed vector.

Returns:
The direction.

components

public Speed[] components()
Get the components of this space vector.

Returns:
The components.

add

public SpeedVec add(SpeedVec p)
Add that speed vector to this speed vector.

Parameters:
p - That speed vector.
Returns:
The sum of the speed vectors.

minus

public SpeedVec minus(SpeedVec p)
Substract that speed vector from this speed vector.

Parameters:
p - That speed vector.
Returns:
The difference of the speed vectors.

times

public SpeedVec times(double f)
Multiply this speed vector by a factor.

Parameters:
f - The multiplication factor.
Returns:
The scaled speed vector.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
o - That object which is compared with this object.
Returns:
True, if this object is the same as that object.

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string.