net.agmodel.weatherData
Class MetElement

java.lang.Object
  |
  +--net.agmodel.weatherData.MetElement
All Implemented Interfaces:
Comparable, Serializable

public final class MetElement
extends Object
implements Serializable, Comparable

A set of type-safe constants that represent the weather elements that can be requested from MetBroker Supports locale dependent names for each element, default element units, and iteration through the set. Use them just like standard int constants eg MetElement.RAIN
(Uses net.agmodel.resources.WeatherDataResources for the element names). Follows the style for typed classes described in "Create enumerated constants in Java" by Eric Armstrong JavaWorld July 1997

See Also:
Serialized Form

Field Summary
static MetElement AIRTEMPERATURE
           
 AbstractUnit defaultUnits
           
static MetElement HUMIDITY
           
static MetElement LEAFWETNESS
           
 String metElementName
           
 int ord
          Used to provide an equivalent of the ord(A) function.
static MetElement RADIATION
           
static MetElement RAIN
           
protected static ResourceBundle rb
           
static MetElement SOILTEMPERATURE
           
static MetElement SUNSHINE
           
static MetElement WATERTEMPERATURE
           
static MetElement WIND
           
 
Method Summary
 int compareTo(Object a)
           
static MetElement elementFromOrd(int ordIndex)
          Gets an element based on its ordinal index.
 boolean equals(Object a)
           
static MetElement first()
           
 String getName()
           
 int hashCode()
           
static Iterator iterator()
           
static MetElement last()
           
 MetElement next()
           
 MetElement prev()
           
static int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rb

protected static ResourceBundle rb

AIRTEMPERATURE

public static final MetElement AIRTEMPERATURE

RAIN

public static final MetElement RAIN

WIND

public static final MetElement WIND

RADIATION

public static final MetElement RADIATION

HUMIDITY

public static final MetElement HUMIDITY

SOILTEMPERATURE

public static final MetElement SOILTEMPERATURE

WATERTEMPERATURE

public static final MetElement WATERTEMPERATURE

LEAFWETNESS

public static final MetElement LEAFWETNESS

SUNSHINE

public static final MetElement SUNSHINE

ord

public final int ord
Used to provide an equivalent of the ord(A) function.


metElementName

public String metElementName

defaultUnits

public AbstractUnit defaultUnits
Method Detail

iterator

public static Iterator iterator()

toString

public String toString()
Overrides:
toString in class Object
Returns:
the name of the element in the language of the default Locale

getName

public String getName()
Returns:
the language independent name of the element

size

public static int size()
Returns:
the number of elements

first

public static MetElement first()
Returns:
the first element in the list

last

public static MetElement last()
Returns:
the last element in the list

prev

public MetElement prev()
Returns:
the previous element to this one in the list

next

public MetElement next()
Returns:
the next element to this one in the list

elementFromOrd

public static MetElement elementFromOrd(int ordIndex)
Gets an element based on its ordinal index.

Parameters:
ordIndex - the ordinal index of an element
Returns:
the element

equals

public boolean equals(Object a)
Overrides:
equals in class Object
Returns:
true if MetElement.A.ord==MetElement.B.ord, regardless of the languages used with A and B

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object a)
Specified by:
compareTo in interface Comparable