uavsim.datatypes
Class RevolutionsPerMinute

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

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

Defines revolutions per minute.

Author:
Dan Tappan [28.06.11]

Field Summary
private  int _rpm
          the RPM
private static int DEFAULT_RPM
          the default RPM
 
Constructor Summary
RevolutionsPerMinute()
          Creates an RPM object with a default 0.
RevolutionsPerMinute(int rpm)
          Creates an RPM object.
 
Method Summary
 RevolutionsPerMinute add_(RevolutionsPerMinute rpm)
          Adds another unit to this one.
 int compareTo(RevolutionsPerMinute rpm)
          
 double getValue_()
          Returns the numerical value of this unit.
private  void setValue(int rpm)
          Sets the RPM.
 RevolutionsPerMinute subtract_(RevolutionsPerMinute rpm)
          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

_rpm

private int _rpm
the RPM


DEFAULT_RPM

private static int DEFAULT_RPM
the default RPM

Constructor Detail

RevolutionsPerMinute

public RevolutionsPerMinute()
Creates an RPM object with a default 0.


RevolutionsPerMinute

public RevolutionsPerMinute(int rpm)
Creates an RPM object.

Parameters:
rpm - - the non-negative RPM
Method Detail

add_

public RevolutionsPerMinute add_(RevolutionsPerMinute rpm)
Adds another unit to this one.

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

compareTo

public int compareTo(RevolutionsPerMinute rpm)

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

getValue_

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

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

setValue

private void setValue(int rpm)
Sets the RPM.

Parameters:
rpm - - the non-negative RPM

subtract_

public RevolutionsPerMinute subtract_(RevolutionsPerMinute rpm)
Subtract another unit from this one. A negative result is illegal.

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

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object