com.bbn.openmap.proj
Enum Length

java.lang.Object
  extended by java.lang.Enum<Length>
      extended by com.bbn.openmap.proj.Length
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Length>

public enum Length
extends java.lang.Enum<Length>

Length is a convenience class used for a couple of things. It can be used to specify unit type, and can be used for conversion from radians to/from whatever units are represented by the implemented class.


Enum Constant Summary
DECIMAL_DEGREE
          Decimal Degrees, in WGS 84 Spherical earth model units.
DM
          Data Mile, in WGS 84 spherical earth model units.
FEET
          Feet, in WGS 84 spherical earth model units.
KM
          Kilometers, in WGS 84 Spherical earth model units.
METER
          Meters, in WGS 84 Spherical earth model units.
MILE
          Miles, in WGS 84 spherical earth model units.
NM
          Nautical Miles, in WGS 84 Spherical earth model units.
RADIAN
          Radians, in terms of a spherical earth.
YARD
          Feet, in WGS 84 spherical earth model units.
 
Field Summary
protected  java.lang.String abbr
           
protected  double constant
          Unit/radians
protected  I18n i18n
           
protected  java.lang.String name
           
protected  double unitEquatorCircumference
           
 
Method Summary
 double fromRadians(double numRadians)
          Given a number of radians, convert to the number of units represented by this length.
 float fromRadians(float numRadians)
          Given a number of radians, convert to the number of units represented by this length.
static Length get(java.lang.String name)
          Get the Length object with the given name or abbreviation.
 java.lang.String getAbbr()
          Return the abbreviation for this length type.
 double toRadians(double numUnits)
           
 float toRadians(float numUnits)
          Given a number of units provided by this Length, convert to a number of radians.
 java.lang.String toString()
          Return the name for this length type.
static Length valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Length[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MILE

public static final Length MILE
Miles, in WGS 84 spherical earth model units.


FEET

public static final Length FEET
Feet, in WGS 84 spherical earth model units.


YARD

public static final Length YARD
Feet, in WGS 84 spherical earth model units.


METER

public static final Length METER
Meters, in WGS 84 Spherical earth model units.


KM

public static final Length KM
Kilometers, in WGS 84 Spherical earth model units.


NM

public static final Length NM
Nautical Miles, in WGS 84 Spherical earth model units.


DECIMAL_DEGREE

public static final Length DECIMAL_DEGREE
Decimal Degrees, in WGS 84 Spherical earth model units.


DM

public static final Length DM
Data Mile, in WGS 84 spherical earth model units.


RADIAN

public static final Length RADIAN
Radians, in terms of a spherical earth.

Field Detail

constant

protected final double constant
Unit/radians


name

protected final java.lang.String name

abbr

protected final java.lang.String abbr

unitEquatorCircumference

protected double unitEquatorCircumference

i18n

protected transient I18n i18n
Method Detail

values

public static Length[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Length c : Length.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Length valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toRadians

public float toRadians(float numUnits)
Given a number of units provided by this Length, convert to a number of radians.


toRadians

public double toRadians(double numUnits)

fromRadians

public float fromRadians(float numRadians)
Given a number of radians, convert to the number of units represented by this length.


fromRadians

public double fromRadians(double numRadians)
Given a number of radians, convert to the number of units represented by this length.


toString

public java.lang.String toString()
Return the name for this length type.

Overrides:
toString in class java.lang.Enum<Length>

getAbbr

public java.lang.String getAbbr()
Return the abbreviation for this length type.


get

public static Length get(java.lang.String name)
Get the Length object with the given name or abbreviation. If nothing exists with that name, then return null. The lower case version of the name or abbreviation is checked against the available options.



Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details