uavsim.datatypes
Class GenericValue

java.lang.Object
  extended by uavsim.datatypes.GenericValue
All Implemented Interfaces:
java.lang.Comparable<GenericValue>, I_Unitable<GenericValue>

public class GenericValue
extends java.lang.Object
implements I_Unitable<GenericValue>

Defines a generic double value as an I_Unitable datatype with no specific unit.

Author:
Dan Tappan [29.06.11]

Field Summary
private  double _value
          the value
 
Constructor Summary
GenericValue(double value)
          Creates a generic value.
 
Method Summary
 GenericValue add_(GenericValue value)
          Adds another unit to this one.
 int compareTo(GenericValue value)
          
 double getValue_()
          Returns the numerical value of this unit.
 GenericValue subtract_(GenericValue value)
          Subtract another unit from this one.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_value

private final double _value
the value

Constructor Detail

GenericValue

public GenericValue(double value)
Creates a generic value.

Parameters:
value - - the value
Method Detail

add_

public GenericValue add_(GenericValue value)
Adds another unit to this one.

Specified by:
add_ in interface I_Unitable<GenericValue>
Parameters:
value - - the unit
Returns:
the result as a new unit

compareTo

public int compareTo(GenericValue value)

Specified by:
compareTo in interface java.lang.Comparable<GenericValue>

getValue_

public double getValue_()
Returns the numerical value of this unit.

Specified by:
getValue_ in interface I_Unitable<GenericValue>
Returns:
the value

subtract_

public GenericValue subtract_(GenericValue value)
Subtract another unit from this one.

Specified by:
subtract_ in interface I_Unitable<GenericValue>
Parameters:
value - - the unit
Returns:
the result as a new unit

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object