uavsim.datatypes
Class NDBFrequency

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

public class NDBFrequency
extends A_Frequency<NDBFrequency>

Defines an NDB frequency in terms of major (KHz) components between 190 and 535 with a step of 1.

Author:
Dan Tappan [14.07.11]

Field Summary
private static int FREQUENCY_MAJOR_MAX
          the largest major frequency
private static int FREQUENCY_MAJOR_MIN
          the smallest major frequency
private static int FREQUENCY_MAJOR_STEP
          the change step in major frequency
private static int FREQUENCY_MINOR_MAX
          the largest minor frequency
private static int FREQUENCY_MINOR_MIN
          the smallest minor frequency
private static int FREQUENCY_MINOR_STEP
          the change step in minor frequency
 
Fields inherited from class uavsim.datatypes.A_Frequency
_frequencyMajor, _frequencyMinor
 
Constructor Summary
NDBFrequency()
          Creates an absolute frequency object with the default 190.
NDBFrequency(int valueMajor)
          Creates an absolute frequency object.
NDBFrequency(int valueMajor, boolean isRelative)
          Creates a relative frequency object.
 
Method Summary
 NDBFrequency add_(NDBFrequency value)
          Adds another unit to this one.
 NDBFrequency subtract_(NDBFrequency value)
          Subtract another unit from this one.
 
Methods inherited from class uavsim.datatypes.A_Frequency
compareTo, formatString, getFrequencyMajor, getFrequencyMinor, getValue_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FREQUENCY_MAJOR_MAX

private static final int FREQUENCY_MAJOR_MAX
the largest major frequency

See Also:
Constant Field Values

FREQUENCY_MAJOR_MIN

private static final int FREQUENCY_MAJOR_MIN
the smallest major frequency

See Also:
Constant Field Values

FREQUENCY_MAJOR_STEP

private static final int FREQUENCY_MAJOR_STEP
the change step in major frequency

See Also:
Constant Field Values

FREQUENCY_MINOR_MAX

private static final int FREQUENCY_MINOR_MAX
the largest minor frequency

See Also:
Constant Field Values

FREQUENCY_MINOR_MIN

private static final int FREQUENCY_MINOR_MIN
the smallest minor frequency

See Also:
Constant Field Values

FREQUENCY_MINOR_STEP

private static final int FREQUENCY_MINOR_STEP
the change step in minor frequency

See Also:
Constant Field Values
Constructor Detail

NDBFrequency

public NDBFrequency()
Creates an absolute frequency object with the default 190. Absolute means the frequency will always remain on the domain.


NDBFrequency

public NDBFrequency(int valueMajor)
Creates an absolute frequency object. Absolute means the frequency will always remain on the domain.

Parameters:
valueMajor - - the major value (KHz)

NDBFrequency

public NDBFrequency(int valueMajor,
                    boolean isRelative)
Creates a relative frequency object. Relative means the frequency is a delta for mathematical manipulation and may stray off the domain.

Parameters:
valueMajor - - the major value (KHz)
isRelative - - ignored; assumed always true
Method Detail

add_

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

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

subtract_

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

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