|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<TimeUnit> umontreal.iro.lecuyer.util.TimeUnit
public enum TimeUnit
Enum Constant Summary | |
---|---|
DAY
Represents a day which has short name d. |
|
HOUR
Represents an hour which has short name h. |
|
MICROSECOND
Represents a microsecond which has short name us. |
|
MILLISECOND
Represents a millisecond which has short name ms. |
|
MINUTE
Represents a minute which has short name min. |
|
NANOSECOND
Represents a nanosecond which has short name ns. |
|
SECOND
Represents a second which has short name s. |
|
WEEK
Represents a week which has short name w. |
Method Summary | |
---|---|
static double |
convert(double value,
TimeUnit srcUnit,
TimeUnit dstUnit)
Converts value expressed in time unit srcUnit to a time duration expressed in dstUnit and returns the result of the conversion. |
double |
getHours()
Returns this time unit represented in hours. |
String |
getLongName()
Returns the long name of this time unit. |
String |
getShortName()
Returns the short name representing this unit in a string specifying a time duration. |
String |
toString()
Calls getLongName . |
static TimeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static TimeUnit[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final TimeUnit NANOSECOND
public static final TimeUnit MICROSECOND
public static final TimeUnit MILLISECOND
public static final TimeUnit SECOND
public static final TimeUnit MINUTE
public static final TimeUnit HOUR
public static final TimeUnit DAY
public static final TimeUnit WEEK
Method Detail |
---|
public static TimeUnit[] values()
for (TimeUnit c : TimeUnit.values()) System.out.println(c);
public static TimeUnit 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 String getShortName()
public String getLongName()
public String toString()
getLongName
.
toString
in class Enum<TimeUnit>
getLongName
.public double getHours()
public static double convert(double value, TimeUnit srcUnit, TimeUnit dstUnit)
value
- the value being converted.srcUnit
- the source time unit.dstUnit
- the destination time unit.
NullPointerException
- if srcUnit or
dstUnit are null.
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |