|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.agmodel.weatherData.MetDuration
A set of type-safe constants for measurement frequencies used in agrometeorology
The ordinal values of these constants are used for persistent storage of metadata,
so they should be changed with caution.
Use them just like standard int constants eg MetDuration.ONE_HOUR
Follows the style for typed classes described in "Create enumerated constants in Java" by Eric Armstrong
JavaWorld July 1997
(Uses net.agmodel.resources.UtilityResources for the duration names).
| Field Summary | |
static MetDuration |
DAILY
|
static MetDuration |
HOURLY
|
static MetDuration |
MONTHLY
|
int |
ord
|
static MetDuration |
SUBHOURLY
|
| Method Summary | |
static MetDuration |
categoriseDuration(Duration input)
Maps the input duration to the nearest MetDuration. If input < 1 hour, MetDuration is sub_hourly if input < 1 day, MetDuration is hourly if input < 1 month, MetDuration is daily else MetDuration is monthly |
int |
compareTo(Object another)
|
static MetDuration |
elementFromOrd(int ordIndex)
Gets a metduration based on its ordinal index. |
static MetDuration |
first()
|
Duration |
getDuration(Duration shortestAvailable)
Maps this metDuration to the appropriate Duration. If monthly, duration is ONE_MONTH if daily, duration is ONE_DAY if hourly, duration is ONE_HOUR else duration is shortestAvailable; |
String |
getName()
|
static Iterator |
iterator()
|
static MetDuration |
last()
|
static MetDuration |
lookup(String name)
Finds the MetDuration whose .toString() matches the parameter |
MetDuration |
next()
|
MetDuration |
prev()
|
static int |
size()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final MetDuration SUBHOURLY
public static final MetDuration HOURLY
public static final MetDuration DAILY
public static final MetDuration MONTHLY
public final int ord
| Method Detail |
public static Iterator iterator()
public String toString()
public String getName()
public static int size()
public static MetDuration first()
public static MetDuration last()
public MetDuration prev()
public MetDuration next()
public static MetDuration lookup(String name)
public int compareTo(Object another)
compareTo in interface Comparablepublic static MetDuration categoriseDuration(Duration input)
input - the Duration to categorise
public static MetDuration elementFromOrd(int ordIndex)
ordIndex - the ordinal index of a duration
public Duration getDuration(Duration shortestAvailable)
shortestAvailable - the shortest duration available from a station
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||