edu.nrao.sss.measure
Enum DistanceUnits

java.lang.Object
  extended by java.lang.Enum<DistanceUnits>
      extended by edu.nrao.sss.measure.DistanceUnits
All Implemented Interfaces:
Symbolic, Serializable, Comparable<DistanceUnits>

public enum DistanceUnits
extends Enum<DistanceUnits>
implements Symbolic

Units of distance or length.

Table of Units

Element Name(s)1 Symbol(s)1 Meters
ANGSTROMANGSTROM Å10-10
NANOMETERNANOMETER nm10-9
MICROMETERMICROMETER µm10-6
MILLIMETERMILLIMETER mm0.001
CENTIMETERCENTIMETER cm0.01
METERMETER m1.0
KILOMETERKILOMETER km1,000.0
MILEMILE mi1,609.347219
ASTRONOMICAL_UNITASTRONOMICAL_UNIT au149,597,870,691.0
LIGHT_SECONDLIGHT_SECOND ls299,792,458.0
LIGHT_MINUTELIGHT_MINUTE lm17,987,547,480.0
LIGHT_YEARLIGHT_YEAR ly9.4607304725808 x 1015
PARSECPARSEC pc3.085677581306 x 1016
KILOPARSECKILOPARSEC kpc3.085677581306 x 1019
MEGAPARSECMEGAPARSEC Mpc3.085677581306 x 1022
1The names in this column may be sent to fromString(String). Note that the names are not case sensitive.

Table of Conversion Factors2

ÅnmµmmmcmmkmmilslmaulypckpcMpc
ANGSTROM10.10.00011E-71E-81E-101E-136.21371192237333969617434184363318221585938121371192237333969617434184363318221585938121E-143.335640951981520495755767144749185117925815198459729096987489925447023754013184681E-195.5594015866358674929262785745819751965430253307662151616458165424117062566886411E-216.684587122670598840976921669305499647220242800053317772259440721774490915237141E-221.05700083402461546370946052448512723335292138770366856065971110776707473129E-263.2407792896390497959062206902856246498984427942833332932554692635801427905E-273.2407792896390497959062206902856246498984427942833332932554692635801428E-303.2407792896390497959062206902856246498984427942833332932554692635801E-33
NANOMETER1E+110.0010.0000011E-71E-91E-126.213711922373339696174341843633182215859381213711922373339696174341843633182215859381214E-133.3356409519815204957557671447491851179258151984597290969874899254470237540131846813E-185.55940158663586749292627857458197519654302533076621516164581654241170625668864114E-206.6845871226705988409769216693054996472202428000533177722594407217744909152371406E-211.057000834024615463709460524485127233352921387703668560659711107767074731289E-253.24077928963904979590622069028562464989844279428333329325546926358014279047E-263.24077928963904979590622069028562464989844279428333329325546926358014279E-293.24077928963904979590622069028562464989844279428333329325546926358014E-32
MICROMETER1E+41E+310.0010.00010.0000011E-96.213711922373339696174341843633182215859381213711922373339696174341843633182215859381213712E-103.3356409519815204957557671447491851179258151984597290969874899254470237540131846812504E-155.55940158663586749292627857458197519654302533076621516164581654241170625668864113542E-176.6845871226705988409769216693054996472202428000533177722594407217744909152371405928E-181.057000834024615463709460524485127233352921387703668560659711107767074731289193E-223.24077928963904979590622069028562464989844279428333329325546926358014279047402E-233.24077928963904979590622069028562464989844279428333329325546926358014279047E-263.24077928963904979590622069028562464989844279428333329325546926358014279E-29
MILLIMETER1E+71E+61E+310.10.0010.0000016.213711922373339696174341843633182215859381213711922373339696174341843633182215859381213711922E-73.3356409519815204957557671447491851179258151984597290969874899254470237540131846812503869E-125.55940158663586749292627857458197519654302533076621516164581654241170625668864113541731E-146.6845871226705988409769216693054996472202428000533177722594407217744909152371405927847E-151.05700083402461546370946052448512723335292138770366856065971110776707473128919331E-193.24077928963904979590622069028562464989844279428333329325546926358014279047402403E-203.24077928963904979590622069028562464989844279428333329325546926358014279047402E-233.24077928963904979590622069028562464989844279428333329325546926358014279047E-26
CENTIMETER1E+81E+71E+41E+110.010.000010.00000621371192237333969617434184363318221585938121371192237333969617434184363318221585938121371192243.33564095198152049575576714474918511792581519845972909698748992544702375401318468125038689E-115.559401586635867492926278574581975196543025330766215161645816542411706256688641135417311E-136.68458712267059884097692166930549964722024280005331777225944072177449091523714059278475E-141.0570008340246154637094605244851272333529213877036685606597111077670747312891933104E-183.240779289639049795906220690285624649898442794283333293255469263580142790474024028E-193.240779289639049795906220690285624649898442794283333293255469263580142790474024E-223.240779289639049795906220690285624649898442794283333293255469263580142790474E-25
METER1E+101E+91E+61E+31E+210.0010.00062137119223733396961743418436331822158593812137119223733396961743418436331822158593812137119223733.3356409519815204957557671447491851179258151984597290969874899254470237540131846812503868927E-95.55940158663586749292627857458197519654302533076621516164581654241170625668864113541731149E-116.6845871226705988409769216693054996472202428000533177722594407217744909152371405927847492E-121.057000834024615463709460524485127233352921387703668560659711107767074731289193310407E-163.24077928963904979590622069028562464989844279428333329325546926358014279047402402802E-173.24077928963904979590622069028562464989844279428333329325546926358014279047402403E-203.24077928963904979590622069028562464989844279428333329325546926358014279047402E-23
KILOMETER1E+131E+121E+91E+61E+51E+310.6213711922373339696174341843633182215859381213711922373339696174341843633182215859381213711922373340.00000333564095198152049575576714474918511792581519845972909698748992544702375401318468125038689265495.55940158663586749292627857458197519654302533076621516164581654241170625668864113541731148776E-86.6845871226705988409769216693054996472202428000533177722594407217744909152371405927847492106E-91.057000834024615463709460524485127233352921387703668560659711107767074731289193310407124E-133.24077928963904979590622069028562464989844279428333329325546926358014279047402402801946E-143.24077928963904979590622069028562464989844279428333329325546926358014279047402402802E-173.24077928963904979590622069028562464989844279428333329325546926358014279047402403E-20
MILE1.609344E+131.609344E+121.609344E+91609344160934.41609.3441.60934410.00000536819375222574812072156931979923257442320313474997426386223498657861499637859468766222264337288.94698958704291353453594886633205429070533855791662377310372497763102499396432447943703773895E-81.07578001783471922211331630269667900242560144288090066368790973689434463074914007901545794335E-81.701077950232510748828038038316992602233123917772572776086342113018295116351875518943843E-135.21552870510486695474290083058702831656615952032311673550092992652712131899262772534894E-145.21552870510486695474290083058702831656615952032311673550092992652712131899262772535E-175.21552870510486695474290083058702831656615952032311673550092992652712131899262773E-20
LIGHT_SECOND2.99792458E+182.99792458E+172.99792458E+142.99792458E+112.99792458E+10299792458299792.458186282.397051220870118507913783504334685437047641772051220870118507913783504334685437047641772051220870118510.01666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666670.00200398880422056635086842246851455889215828945638478666600074194768606875317761203120251703075091063.16880878140289502370268968489365477729611884300453773417496894567394225162876771364108804218E-89.7156118907638467109912423823118413585844361567058883641829195247214088714718664851101333699E-99.7156118907638467109912423823118413585844361567058883641829195247214088714718664851101334E-129.7156118907638467109912423823118413585844361567058883641829195247214088714718664851101E-15
LIGHT_MINUTE1.798754748E+201.798754748E+191.798754748E+161.798754748E+131.798754748E+121.798754748E+1017987547.4811176943.82307325220711047482701026008112622285850632307325220711047482701026008112622285850632307325220711056E+110.12023932825323398105210534811087353352949736738308719996004451686116412519065672187215102184505463820.00000190128526884173701422161381093619286637767130580272264050498136740436535097726062818465282530995.829367134458308026594745429387104815150661694023533018509751714832845322883119891066080021966E-75.829367134458308026594745429387104815150661694023533018509751714832845322883119891066080022E-105.82936713445830802659474542938710481515066169402353301850975171483284532288311989106608E-13
ASTRONOMICAL_UNIT1.49597870691E+211.49597870691E+201.49597870691E+171.49597870691E+141.49597870691E+13149597870691149597870.69192955807.2674331901694106418515867334764972560248150799331901694106418515867334764972560248150799331901694106499.00478380613564334563746763769487489908768818994105582202471551168908992366979425479743056111171415798.31674639676892738909395779396158124831812813649901759703374525852815149872782990424662384268519523610.0000158125074088693577251006878735295103207812916124781686763893551953155211398734312575987220371990.00000484813681109493407432088743987857636231669391421458808020886873321587196884648953138081415233824.8481368110949340743208874398785763623166939142145880802088687332158719688464895313808141523E-94.8481368110949340743208874398785763623166939142145880802088687332158719688464895313808142E-12
LIGHT_YEAR9.4607304725808E+259.4607304725808E+249.4607304725808E+219.4607304725808E+189.4607304725808E+179.4607304725808E+159460730472580.85878625373183.607730851825340014316392269148174659985683607730851825340014316392269148174659985683607730851825343.15576E+75.2596E+563241.077088070944674165328892395043695174435348808543690985014088297883285277809435876551449624937496163310.30660139380396916896677723060404416485766420245886174264153890119334833260236057379051154483534599310.0003066013938039691689667772306040441648576642024588617426415389011933483326023605737905115448353463.066013938039691689667772306040441648576642024588617426415389011933483326023605737905115448353E-7
PARSEC3.085677581306E+263.085677581306E+253.085677581306E+223.085677581306E+193.085677581306E+183.085677581306E+163.085677581306E+1319173511575561.2224608287600413584665553169490177364193112224608287600413584665553169490177364193112224608287600414102927125.04815581451351921601710207132695779825121551256636349404093414518119732018074984394704152297253588681715452.0841359302418919869336183678554492966375202585427727249006822357530199553363458307324506920495422648206264.80624711447350984274578708014132238395069550582551346135189089394015698410245763516019161305109220733.261563776971500193725733769903353592382113920298613093719531714735409067267387893272930892939942295110.0010.000001
KILOPARSEC3.085677581306E+293.085677581306E+283.085677581306E+253.085677581306E+223.085677581306E+213.085677581306E+193.085677581306E+1619173511575561222.4608287600413584665553169490177364193112224608287600413584665553169490177364193112224608287600413585102927125048.15581451351921601710207132695779825121551256636349404093414518119732018074984394704152297253588681011715452084.1359302418919869336183678554492966375202585427727249006822357530199553363458307324506920495422647802206264806.24711447350984274578708014132238395069550582551346135189089394015698410245763516019161305109220727343261.56377697150019372573376990335359238211392029861309371953171473540906726738789327293089293994229512181E+310.001
MEGAPARSEC3.085677581306E+323.085677581306E+313.085677581306E+283.085677581306E+253.085677581306E+243.085677581306E+223.085677581306E+1919173511575561222460.8287600413584665553169490177364193112224608287600413584665553169490177364193112224608287600413584666102927125048155.81451351921601710207132695779825121551256636349404093414518119732018074984394704152297253588681006781715452084135.9302418919869336183678554492966375202585427727249006822357530199553363458307324506920495422647801678206264806247.11447350984274578708014132238395069550582551346135189089394015698410245763516019161305109220727337423261563.77697150019372573376990335359238211392029861309371953171473540906726738789327293089293994229512180541E+61E+31
2This table was generated from the conversion logic of this class.

Version Info:

$Revision: 1586 $
$Date: 2008-10-01 10:38:49 -0600 (Wed, 01 Oct 2008) $
$Author: dharland $

Since:
2006-05-03
Author:
David M. Harland

Enum Constant Summary
ANGSTROM
           
ASTRONOMICAL_UNIT
           
CENTIMETER
           
KILOMETER
           
KILOPARSEC
           
LIGHT_MINUTE
           
LIGHT_SECOND
           
LIGHT_YEAR
           
MEGAPARSEC
           
METER
           
MICROMETER
           
MILE
           
MILLIMETER
           
NANOMETER
           
PARSEC
           
 
Method Summary
static DistanceUnits fromString(String text)
          Returns the distance units represented by text.
static DistanceUnits getDefault()
          Returns a unit of distance.
 String getSymbol()
          Returns the symbol for this unit.
 boolean symbolsAreCaseSensitive()
          Returns false -- these symbols are not case sensitive.
 BigDecimal toMeters()
          Returns the number of meters in one of these units.
 String toString()
          Returns a text representation of this enumeration constant.
 BigDecimal toUnits(DistanceUnits otherUnits)
          Returns a factor for converting from this unit to otherUnits.
static DistanceUnits valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DistanceUnits[] 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

METER

public static final DistanceUnits METER

KILOMETER

public static final DistanceUnits KILOMETER

CENTIMETER

public static final DistanceUnits CENTIMETER

MILLIMETER

public static final DistanceUnits MILLIMETER

MICROMETER

public static final DistanceUnits MICROMETER

NANOMETER

public static final DistanceUnits NANOMETER

ANGSTROM

public static final DistanceUnits ANGSTROM

ASTRONOMICAL_UNIT

public static final DistanceUnits ASTRONOMICAL_UNIT

LIGHT_YEAR

public static final DistanceUnits LIGHT_YEAR

LIGHT_MINUTE

public static final DistanceUnits LIGHT_MINUTE

LIGHT_SECOND

public static final DistanceUnits LIGHT_SECOND

PARSEC

public static final DistanceUnits PARSEC

KILOPARSEC

public static final DistanceUnits KILOPARSEC

MEGAPARSEC

public static final DistanceUnits MEGAPARSEC

MILE

public static final DistanceUnits MILE
Method Detail

values

public static DistanceUnits[] 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 (DistanceUnits c : DistanceUnits.values())
    System.out.println(c);

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

valueOf

public static DistanceUnits valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

symbolsAreCaseSensitive

public boolean symbolsAreCaseSensitive()
Returns false -- these symbols are not case sensitive.

Specified by:
symbolsAreCaseSensitive in interface Symbolic
Returns:
true if the case of the symbols carry meaning.

getSymbol

public String getSymbol()
Returns the symbol for this unit. For example, the symbol for KILOMETER is km.

Specified by:
getSymbol in interface Symbolic
Returns:
the symbol for this unit.

toMeters

public BigDecimal toMeters()
Returns the number of meters in one of these units.

Returns:
the number of meters in one of these units.

toUnits

public BigDecimal toUnits(DistanceUnits otherUnits)
Returns a factor for converting from this unit to otherUnits.

Parameters:
otherUnits - the unit to which conversion is desired.
Returns:
a factor for converting from this unit to otherUnits.

getDefault

public static DistanceUnits getDefault()
Returns a unit of distance.

Returns:
a unit of distance.

toString

public String toString()
Returns a text representation of this enumeration constant.

Overrides:
toString in class Enum<DistanceUnits>
Returns:
a text representation of this enumeration constant.

fromString

public static DistanceUnits fromString(String text)
Returns the distance units represented by text.

For details about the transformation, see EnumerationUtility.enumFromString(Class, String).

Parameters:
text - a text representation of a unit of distance.
Returns:
the distance units represented by text.


Copyright © 2009. All Rights Reserved.