public class Time extends Quantity
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).
AbstractScienceObject.EventMonitor
Modifier and Type | Field and Description |
---|---|
static String |
DAY |
static String |
DAYABBREV |
static String |
DEFAULTUNITS_PROPERTY |
static String |
HOUR |
static String |
HOURABBREV |
static String |
MINUTE |
static String |
MINUTEABBREV |
static String |
SECOND |
static String |
SECONDABBREV |
NAME_PROPERTY, PENDING_PROPERTY, VALID_PROPERTY
Constructor and Description |
---|
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,
String inUnits)
Primary constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultUnitsChangeListener(PropertyChangeListener listener) |
static double |
convert(double inVal,
String fromUnits,
String toUnits)
The workhorse of the Time class.
|
static String |
getDefaultUnitsAbbrev() |
static String |
getUnitsAbbrev(String unitType) |
double |
getValue(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(PropertyChangeListener listener) |
protected void |
setValue(double inValue,
String unitsName)
Sets the value with the specified units
|
add, addDefaultUnitsChangeListener, equals, fireDefaultUnitsChange, fireDefaultUnitsChange, getAllUnits, getAllUnits, getAllUnitsAbbrev, getAllUnitsAbbrev, getDefaultUnits, getDefaultUnits, getDefaultUnitsAbbrev, getDefaultUnitsProperty, getUnitsAbbrev, getUnitsIgnoreCase, getValue, hashCode, initializeSubClass, isInitialized, removeDefaultUnitsChangeListener, setDefaultUnits, toString, toString
addEventMonitor, addPropertyChangeListener, areNamesEqual, clearAllListeners, clone, compareTo, createDefaultName, firePropertyChange, firePropertyChange, fireReplaceObject, fireReplaceObject, fireReplaceObject, fireVetoableChange, fireVetoableChange, getException, getLabel, getName, getObjectIdString, getObjectIdString, getParent, isHolding, isPending, isTracing, isValid, notifyEventMonitors, propertyChange, removeEventMonitor, removePropertyChangeListener, replaceObject, replaceObjectNYI, setException, setHolding, setName, setParent, setTraceAll, setTracing, writeDebug, writeError
public static final String DEFAULTUNITS_PROPERTY
public static final String SECOND
public static final String MINUTE
public static final String HOUR
public static final String DAY
public static final String SECONDABBREV
public static final String MINUTEABBREV
public static final String HOURABBREV
public static final String DAYABBREV
public Time()
public Time(double inValue)
public Time(double inValue, String inUnits)
inValue
- double of the time quantityinUnits
- string containing the units in which the value is givenpublic Quantity newInstance(double inValue)
newInstance
in class Quantity
public double getValue(String unitsName)
protected void setValue(double inValue, String unitsName)
public static double convert(double inVal, String fromUnits, String toUnits) throws UnitsNotSupportedException
UnitsNotSupportedException
public static void addDefaultUnitsChangeListener(PropertyChangeListener listener)
public static void removeDefaultUnitsChangeListener(PropertyChangeListener listener)
public static String getDefaultUnitsAbbrev()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.