|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.measures.Time
public class Time
Time provides an object which represents a span of time in one of several different time units. Time objects are immutable - you cannot change the time span or the units. You can however, create new Time objects in different units from existing time objects with the getMagnitude(Object unit) method.
The supported units, grouped by type with full name followed by abbreviation, are as follows:
| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Fields inherited from class com.sas.measures.Measure |
|---|
DISPLAY_FORMAT_NOSPACE_BETWEEN_MAGNITUDE_AND_UNIT, DISPLAY_FORMAT_SPACE_BETWEEN_MAGNITUDE_AND_UNIT, displayFormat, locale, magnitude |
| Constructor Summary | |
|---|---|
Time(double magnitude,
java.lang.String unitOfTime)
Constructs a Time object from the specified magnitude and unit of time |
|
Time(long millis)
Constructs a Time object from a measure of millisecnds |
|
Time(java.lang.String text)
Constructs a Time object from a string consisting of a numeric value and unit of time. |
|
| Method Summary | |
|---|---|
double |
getMagnitude(java.lang.Object unit)
Returns an equivalent magnitude of the current time measurement in terms of the specified unit of time. |
java.lang.Object |
getUnit()
Returns the abbreviated name of the unit property. |
java.lang.String |
getUnitName()
Returns the full name value of the unit property. |
protected void |
initializeUnit(java.lang.Object unit)
Initializes a unit. |
static AssociationListInterface |
makeUnitsAssociationList()
|
static StaticOrderedCollectionInterface |
makeUnitsList()
|
boolean |
validateUnit(java.lang.String unit)
Returns true if the specified unit is a supported unit of measure, false otherwise. |
| Methods inherited from class com.sas.measures.Measure |
|---|
_init, clone, equals, equals, getMagnitude, hashCode, toString |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public Time(double magnitude,
java.lang.String unitOfTime)
magnitude - numeric value of the measurementunit - unit of time
java.lang.IllegalArgumentException - if the unit is not a supported unit of timepublic Time(java.lang.String text)
text - a string consisting of a number,
some whitespace, and a supported units token, such as
"10 s" or "2.5e12 ns"
java.lang.IllegalArgumentException - if the unit is not a supported unit of measurepublic Time(long millis)
millis - | Method Detail |
|---|
public double getMagnitude(java.lang.Object unit)
getMagnitude in interface com.sas.measures.MeasureInterfacegetMagnitude in class com.sas.measures.Measureunit - the unit of time to convert to
java.lang.IllegalArgumentException - if the unit is not a supported unit of timepublic java.lang.Object getUnit()
getUnit in interface com.sas.measures.MeasureInterfacegetUnit in class com.sas.measures.Measurepublic java.lang.String getUnitName()
getUnitName in interface com.sas.measures.MeasureInterfacegetUnitName in class com.sas.measures.Measureprotected void initializeUnit(java.lang.Object unit)
initializeUnit in class com.sas.measures.Measureunit - the unit to initialize
java.lang.IllegalArgumentException - if the unit is not a supported unit of measurepublic boolean validateUnit(java.lang.String unit)
unit - the unit of measure to validatepublic static AssociationListInterface makeUnitsAssociationList()
public static StaticOrderedCollectionInterface makeUnitsList()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||