|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.science.AbstractScienceObject
jsky.science.Quantity
jsky.science.Time
public class Time
Time, an object to manage quantities of Time. This is not Time of Day based (see Java Calendar class for that stuff), but rather amounts of Time.
Currently support units are: SECOND, MINUTE, HOUR, DAY
This code was developed by NASA, Goddard Space Flight Center, Code 587 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jsky.science.AbstractScienceObject |
---|
AbstractScienceObject.EventMonitor |
Field Summary | |
---|---|
static java.lang.String |
DAY
|
static java.lang.String |
DAYABBREV
|
static java.lang.String |
DEFAULTUNITS_PROPERTY
|
static java.lang.String |
HOUR
|
static java.lang.String |
HOURABBREV
|
static java.lang.String |
MINUTE
|
static java.lang.String |
MINUTEABBREV
|
static java.lang.String |
SECOND
|
static java.lang.String |
SECONDABBREV
|
Fields inherited from class jsky.science.Quantity |
---|
fValue |
Fields inherited from interface jsky.science.ScienceObjectModel |
---|
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY |
Constructor Summary | |
---|---|
Time()
Creates a default Time of length 0 in the default units. |
|
Time(double inValue)
Create a Time quantity of specified value in the default units. |
|
Time(double inValue,
java.lang.String inUnits)
Primary constructor. |
Method Summary | |
---|---|
static void |
addDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
|
static double |
convert(double inVal,
java.lang.String fromUnits,
java.lang.String toUnits)
The workhorse of the Time class. |
static java.lang.String |
getDefaultUnitsAbbrev()
|
static java.lang.String |
getUnitsAbbrev(java.lang.String unitType)
|
double |
getValue(java.lang.String unitsName)
Returns value in specified Units. |
Quantity |
newInstance(double inValue)
returns a new Time object with the specified value in the default units. |
static void |
removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
|
protected void |
setValue(double inValue,
java.lang.String unitsName)
Sets the value with the specified units |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULTUNITS_PROPERTY
public static final java.lang.String SECOND
public static final java.lang.String MINUTE
public static final java.lang.String HOUR
public static final java.lang.String DAY
public static final java.lang.String SECONDABBREV
public static final java.lang.String MINUTEABBREV
public static final java.lang.String HOURABBREV
public static final java.lang.String DAYABBREV
Constructor Detail |
---|
public Time()
public Time(double inValue)
public Time(double inValue, java.lang.String inUnits)
inValue
- double of the time quantityinUnits
- string containing the units in which the value is givenMethod Detail |
---|
public Quantity newInstance(double inValue)
newInstance
in class Quantity
public double getValue(java.lang.String unitsName)
getValue
in class Quantity
protected void setValue(double inValue, java.lang.String unitsName)
setValue
in class Quantity
public static double convert(double inVal, java.lang.String fromUnits, java.lang.String toUnits) throws UnitsNotSupportedException
UnitsNotSupportedException
public static void addDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
public static void removeDefaultUnitsChangeListener(java.beans.PropertyChangeListener listener)
public static java.lang.String getDefaultUnitsAbbrev()
public static java.lang.String getUnitsAbbrev(java.lang.String unitType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |