faa.tg.radix
Class ARadix

java.lang.Object
  extended by faa.tg.radix.ARadix
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BeaconUnits

public class ARadix
extends java.lang.Object
implements java.io.Serializable

 ARadix is an abstract base class for converting numbers of a different
 radix.  A different derived class is created for each kind of use

 Classes derived from ARadix are used to set and get values of classes
 derived from ARadixUnit descendants.  This provides type safety in that
 mixing different types of radix would not be allowed. 
 These classes are shamelessly borrowed from the Units package

 
 See the source:  ARadix.java 
 
 

Version:
$Id: ARadix.java,v 3.1 2006/03/14 15:57:44 samf Exp $
Author:
Michael E. Ross (modeled after Robert G. Oliver's Units Classes)
See Also:
Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
(package private)  java.lang.String itsAbbr
           
(package private)  int itsBase
           
(package private)  java.lang.String itsName
           
(package private) static long serialVersionUID
           
 
Constructor Summary
protected ARadix(int theValue, java.lang.String fullName, java.lang.String shortName)
          This constructor specifies a base other then base 10.
protected ARadix(java.lang.String fullName, java.lang.String shortName)
          This constructor specifies numbers in base 10.
 
Method Summary
 java.lang.String abbr()
          Returns the abbreviation of the units this class specifies
 java.lang.String convertFromBase(int theValue)
          Takes a value in canonical units and returns the value in units described by this class.
 java.lang.String convertToBase(int theValue)
          Takes a value in the units described by this class and returns the value in canonical units.
 java.lang.String name()
          Returns the name of the units this class specifies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

itsBase

int itsBase

itsName

java.lang.String itsName

itsAbbr

java.lang.String itsAbbr
Constructor Detail

ARadix

protected ARadix(java.lang.String fullName,
                 java.lang.String shortName)
This constructor specifies numbers in base 10. These are the units that ARadixUnit.itsValue is actually stored in. example: BeaconUnits beacon = new BeaconUnits("Octal","oct");

Parameters:
fullName - the full name of the radix (ex. "octal")
shortName - the abbreviated name of the radix (ex. "oct)

ARadix

protected ARadix(int theValue,
                 java.lang.String fullName,
                 java.lang.String shortName)
This constructor specifies a base other then base 10.

Parameters:
theValue - value of new base in terms of specified radix
fullName - the full name of the radix (ex. "octal")
shortName - the abbreviated name of the radix (ex. "oct")
Method Detail

convertToBase

public java.lang.String convertToBase(int theValue)
Takes a value in the units described by this class and returns the value in canonical units.

Parameters:
theValue - a value in units of this class
Returns:
a value in canonical units

convertFromBase

public java.lang.String convertFromBase(int theValue)
Takes a value in canonical units and returns the value in units described by this class.

Parameters:
theValue - a value in canonical units
Returns:
a value in units of this class

name

public java.lang.String name()
Returns the name of the units this class specifies

Returns:
the name of the units (ex: octal)

abbr

public java.lang.String abbr()
Returns the abbreviation of the units this class specifies

Returns:
the abbreviation of the units, eg: oct (for octal)