uavsim.support
Class Support

java.lang.Object
  extended by uavsim.support.Support

public abstract class Support
extends java.lang.Object

Provides general-purpose support functionality globally throughout the system. It is declared abstract to play a singleton role.

Author:
Dan Tappan [21.06.11]

Field Summary
static java.lang.String NEWLINE
          newline
 
Constructor Summary
private Support()
          Prevents subclassing and inadvertent instantiation.
 
Method Summary
static boolean areEqual(double value1, double value2)
          Determines whether two doubles are within 0.00001 of each other.
static int round(double value)
          Rounds a real value to an integer.
static int roundFloor(double value)
          Rounds a real value to an integer not less than 1.
static int roundFloor(double value, int floor)
          Rounds a real value to an integer not less than a floor.
static double roundTenth(double value)
          Rounds a real value to a tenth.
static int roundUp(double value)
          Rounds up an integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEWLINE

public static final java.lang.String NEWLINE
newline

See Also:
Constant Field Values
Constructor Detail

Support

private Support()
Prevents subclassing and inadvertent instantiation.

Method Detail

areEqual

public static boolean areEqual(double value1,
                               double value2)
Determines whether two doubles are within 0.00001 of each other.

Parameters:
value1 - - the first value
value2 - - the second value
Returns:
the result

round

public static int round(double value)
Rounds a real value to an integer.

Parameters:
value - - the value
Returns:
the integer

roundFloor

public static int roundFloor(double value)
Rounds a real value to an integer not less than 1.

Parameters:
value - - the value
Returns:
the integer

roundFloor

public static int roundFloor(double value,
                             int floor)
Rounds a real value to an integer not less than a floor.

Parameters:
value - - the value
floor - - the floor
Returns:
the integer

roundTenth

public static double roundTenth(double value)
Rounds a real value to a tenth.

Parameters:
value - - the value
Returns:
the result

roundUp

public static int roundUp(double value)
Rounds up an integer.

Parameters:
value - - the value
Returns:
the result