uavsim.datatypes
Class DeviationFree

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

public class DeviationFree
extends A_Deviation<DeviationFree>

Defines a percent deviation from zero on the interval [-1,+1]. This variant, unlike Deviation, does not consider a value off this interval to be an error.

Author:
Dan Tappan [26.10.11]

Field Summary
 
Fields inherited from class uavsim.datatypes.A_Deviation
_deviation, DEVIATION_MAX, DEVIATION_MIN
 
Constructor Summary
DeviationFree(double deviation)
          Creates a deviation object.
DeviationFree(double deviation, boolean isClamped)
          Creates a deviation object.
 
Method Summary
 DeviationFree add_(DeviationFree deviation)
          Adds another unit to this one.
 Deviation convertToDeviation()
          Converts this deviation to a Deviation.
protected  void setValue(double deviation)
          Sets the deviation.
 DeviationFree subtract_(DeviationFree deviation)
          Subtract another unit from this one.
 
Methods inherited from class uavsim.datatypes.A_Deviation
compareTo, getValue_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviationFree

public DeviationFree(double deviation)
Creates a deviation object.

Parameters:
deviation - - the deviation

DeviationFree

public DeviationFree(double deviation,
                     boolean isClamped)
Creates a deviation object.

Parameters:
deviation - - the deviation on the interval [-1,+1].
isClamped - - zzz
Method Detail

add_

public DeviationFree add_(DeviationFree deviation)
Adds another unit to this one. The result may exceed the limits [-1,+1].

Parameters:
deviation - - the unit
Returns:
the result as a new unit

convertToDeviation

public Deviation convertToDeviation()
Converts this deviation to a Deviation. This fails is the free deviation is not on the interval [-1,+1].

Returns:
the deviation

setValue

protected void setValue(double deviation)
Sets the deviation.

Specified by:
setValue in class A_Deviation<DeviationFree>
Parameters:
deviation - - the deviation

subtract_

public DeviationFree subtract_(DeviationFree deviation)
Subtract another unit from this one. The result may exceed the limits [-1,+1].

Parameters:
deviation - - the unit
Returns:
the result as a new unit