|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<TimeUnits> edu.nrao.sss.measure.TimeUnits
public enum TimeUnits
Units of time.
This class enumerates those units of time that are well defined. The unit month, for example, is not considered to be well-defined because sometimes it is 28 days, sometimes 29, and so on.
Table of Units
Element | Name(s)1 | Symbol(s)1 | Seconds |
---|---|---|---|
MICROSECOND | MICROSECOND | µs | 10-6 |
MILLISECOND | MILLISECOND | ms | 0.001 |
SECOND | SECOND | s | 1.0 |
MINUTE | MINUTE | m | 60.0 |
HOUR | HOUR | h | 3,600.0 |
DAY | DAY | d | 86,400.0 |
YEAR | YEAR | y | 31,556,925.18748800 |
fromString(String)
. Note that the names are
not case sensitive.Table of Conversion Factors2
ns | µs | ms | s | m | h | d | w | ty | y | |
---|---|---|---|---|---|---|---|---|---|---|
NANOSECOND | 1 | 0.001 | 0.000001 | 1E-9 | 1.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666667E-11 | 2.777777777777777777777777777777777777777777777777777777777777777777777777777777777777778E-13 | 1.15740740740740740740740740740740740740740740740740740740740740740740740740740740740741E-14 | 1.6534391534391534391534391534391534391534391534391534391534391534391534391534391534392E-15 | 3.16887653663353660911395687389964307585456367629474904594101671868225683971378495887E-17 | |
MICROSECOND | 1E+3 | 1 | 0.001 | 0.000001 | 1.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667E-8 | 2.777777777777777777777777777777777777777777777777777777777777777777777777777777777777777778E-10 | 1.15740740740740740740740740740740740740740740740740740740740740740740740740740740740740741E-11 | 1.6534391534391534391534391534391534391534391534391534391534391534391534391534391534391534E-12 | 3.16887653663353660911395687389964307585456367629474904594101671868225683971378495887162E-14 | |
MILLISECOND | 1E+6 | 1E+3 | 1 | 0.001 | 0.0000166666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 | 2.777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777778E-7 | 1.15740740740740740740740740740740740740740740740740740740740740740740740740740740740740740741E-8 | 1.6534391534391534391534391534391534391534391534391534391534391534391534391534391534391534392E-9 | 3.16887653663353660911395687389964307585456367629474904594101671868225683971378495887162299E-11 | |
SECOND | 1E+9 | 1E+6 | 1E+3 | 1 | 0.0166666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 | 0.0002777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777778 | 0.0000115740740740740740740740740740740740740740740740740740740740740740740740740740740740740740740741 | 0.0000016534391534391534391534391534391534391534391534391534391534391534391534391534391534391534391534 | 3.16887653663353660911395687389964307585456367629474904594101671868225683971378495887162298978E-8 | |
MINUTE | 6E+10 | 6E+7 | 6E+4 | 6E+1 | 1 | 0.0166666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 | 0.0006944444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 | 0.0000992063492063492063492063492063492063492063492063492063492063492063492063492063492063492063492063 | 0.0000019013259219801219654683741243397858455127382057768494275646100312093541038282709753229737938657 | |
HOUR | 3.6E+12 | 3.6E+9 | 3.6E+6 | 3.6E+3 | 6E+1 | 1 | 0.0416666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 | 0.005952380952380952380952380952380952380952380952380952380952380952380952380952380952380952380952381 | 0.0001140795553188073179281024474603871507307642923466109656538766018725612462296962585193784276319423 | |
DAY | 8.64E+13 | 8.64E+10 | 8.64E+7 | 8.64E+4 | 1.44E+3 | 24 | 1 | 0.1428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571429 | 0.0027379093276513756302744587390492916175383430163186631756930384449414699095127102044650822631666143 | |
WEEK | 6.048E+14 | 6.048E+11 | 6.048E+8 | 6.048E+5 | 1.008E+4 | 168 | 7 | 1 | 0.0191653652935596294119212111733450413227684011142306422298512691145902893665889714312555758421662999 | |
YEAR | 3.15569252522016E+16 | 31556925252201.6 | 31556925252.2016 | 31556925.2522016 | 525948.75420336 | 8765.812570056 | 365.242190419 | 52.1774557741428571428571428571428571428571428571428571428571428571428571428571428571428571428571428571 | 1 |
Version Info:
$Revision: 1725 $ |
$Date: 2008-11-20 15:40:30 -0700 (Thu, 20 Nov 2008) $ |
$Author: switz $ |
Enum Constant Summary | |
---|---|
DAY
One day, or 24 hours. |
|
HOUR
One hour, or 60 minutes. |
|
MICROSECOND
One millionth of a second. |
|
MILLISECOND
One thousandth of a second. |
|
MINUTE
One minute, or 60 seconds. |
|
NANOSECOND
One billionth of a second. |
|
SECOND
One second. |
|
TROPICAL_YEAR
Deprecated. Same as YEAR . |
|
WEEK
One week, or 7 days. |
|
YEAR
A tropical, as opposed to sidereal (or any other kind of), year. |
Method Summary | |
---|---|
static TimeUnits |
fromString(String text)
Returns the time units represented by text . |
static TimeUnits |
getDefault()
Returns a default unit of time. |
String |
getSymbol()
Returns the symbol for this unit. |
boolean |
symbolsAreCaseSensitive()
Returns false -- these symbols are not case sensitive. |
BigDecimal |
toSeconds()
Returns the number of seconds in one of these units. |
String |
toString()
Returns a text representation of this enumeration constant. |
BigDecimal |
toUnits(TimeUnits otherUnits)
Returns a factor for converting from this unit to otherUnits . |
static TimeUnits |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static TimeUnits[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
@Deprecated public static final TimeUnits TROPICAL_YEAR
YEAR
.public static final TimeUnits YEAR
The length of this year is taken as the J2000 value of 365.242 189 670 SI days. See Wikipedia for more information.
public static final TimeUnits WEEK
public static final TimeUnits DAY
Note that this is one SI day, or one that does not vary with the earth's rotation and that never includes a leap second. It is exactly equal to 86,400.0 SI seconds.
public static final TimeUnits HOUR
public static final TimeUnits MINUTE
public static final TimeUnits SECOND
public static final TimeUnits MILLISECOND
public static final TimeUnits MICROSECOND
public static final TimeUnits NANOSECOND
Method Detail |
---|
public static TimeUnits[] values()
for (TimeUnits c : TimeUnits.values()) System.out.println(c);
public static TimeUnits valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic boolean symbolsAreCaseSensitive()
symbolsAreCaseSensitive
in interface Symbolic
public String getSymbol()
MILLISECOND
is ms.
getSymbol
in interface Symbolic
public BigDecimal toSeconds()
public BigDecimal toUnits(TimeUnits otherUnits)
otherUnits
.
otherUnits
- the unit to which conversion is desired.
otherUnits
.public static TimeUnits getDefault()
public String toString()
toString
in class Enum<TimeUnits>
public static TimeUnits fromString(String text)
text
.
For details about the transformation, see
EnumerationUtility.enumFromString(Class, String)
.
text
- a text representation of a unit of time.
text
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |