public class Length
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
abbr |
protected double |
constant
Unit/radians
|
static Length |
DECIMAL_DEGREE
Decimal Degrees, in WGS 84 Spherical earth model units.
|
static Length |
DM
Data Mile, in WGS 84 spherical earth model units.
|
static Length |
FEET
Feet, in WGS 84 spherical earth model units.
|
protected I18n |
i18n |
static Length |
KM
Kilometers, in WGS 84 Spherical earth model units.
|
static Length |
METER
Meters, in WGS 84 Spherical earth model units.
|
static Length |
MILE
Miles, in WGS 84 spherical earth model units.
|
protected java.lang.String |
name |
static Length |
NM
Nautical Miles, in WGS 84 Spherical earth model units.
|
static Length |
RADIAN
Radians, in terms of a spherical earth.
|
protected double |
unitEquatorCircumference |
static Length |
YARD
Feet, in WGS 84 spherical earth model units.
|
Constructor and Description |
---|
Length(java.lang.String name,
java.lang.String abbr,
double unitEquatorCircumference)
Create a Length, with a name an the number of it's units that go around
the earth at its equator.
|
Modifier and Type | Method and Description |
---|---|
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.
|
static Length[] |
getAvailable()
Get a list of the Lengths currently defined as static implementations of
this class.
|
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.
|
public static final Length MILE
public static final Length FEET
public static final Length YARD
public static final Length METER
public static final Length KM
public static final Length NM
public static final Length DECIMAL_DEGREE
public static final Length DM
public static final Length RADIAN
protected final double constant
protected final java.lang.String name
protected final java.lang.String abbr
protected double unitEquatorCircumference
protected transient I18n i18n
public Length(java.lang.String name, java.lang.String abbr, double unitEquatorCircumference)
public float toRadians(float numUnits)
public double toRadians(double numUnits)
public float fromRadians(float numRadians)
public double fromRadians(double numRadians)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getAbbr()
public static Length[] getAvailable()
public static Length get(java.lang.String name)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details