net.sf.marineapi.nmea.util
Enum Units

java.lang.Object
  extended by java.lang.Enum<Units>
      extended by net.sf.marineapi.nmea.util.Units
All Implemented Interfaces:
Serializable, Comparable<Units>

public enum Units
extends Enum<Units>

Defines the supported units of measure.

Author:
Kimmo Tuukkanen

Enum Constant Summary
CELSIUS
          Temperature in degrees Celsius (centigrade)
FATHOMS
          Depth in fathoms
FEET
          Length in feet
KMH
          Speed in kilometers per hour
KNOT
          Speed in knots (nautical miles per hour)
METER
          Length in meter
 
Method Summary
 char toChar()
          Returns the corresponding char constant.
static Units valueOf(char ch)
          Get the enum corresponding to specified char.
static Units valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Units[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CELSIUS

public static final Units CELSIUS
Temperature in degrees Celsius (centigrade)


FATHOMS

public static final Units FATHOMS
Depth in fathoms


FEET

public static final Units FEET
Length in feet


KMH

public static final Units KMH
Speed in kilometers per hour


KNOT

public static final Units KNOT
Speed in knots (nautical miles per hour)


METER

public static final Units METER
Length in meter

Method Detail

values

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

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

valueOf

public static Units 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

toChar

public char toChar()
Returns the corresponding char constant.

Returns:
Char indicator of enum

valueOf

public static Units valueOf(char ch)
Get the enum corresponding to specified char.

Parameters:
ch - Char indicator for unit
Returns:
Units enum


Copyright (C) 2010-2014 Java Marine API authors. All Rights Reserved.