public enum TimeSpanUnit extends Enum<TimeSpanUnit>
Enum Constant and Description |
---|
d
Day = Hour*24
|
D
Day = Hour*24
|
h
Hour = Minute*60
|
H
Hour = Minute*60
|
m
Minute = Second*60
|
M
Month = Day*31
|
MS
Millisecond = 1
|
s
Second = Millisecond*1000
|
S
Second = Millisecond*1000
|
w
Week = Day*7
|
W
Week = Day*7
|
y
Year = Day*365
|
Y
Year = Day*365
|
Modifier and Type | Method and Description |
---|---|
String |
getUnitName()
The unit name
|
String |
getUnitName(long value)
The unit name as singular or prural.
|
long |
getUnitSpanInMilliSeconds()
The unit timespan in milliseconds.
|
long |
toMilliSeconds(double value)
Converts the enum TimeSpanUnit into milliseconds.
|
static TimeSpanUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimeSpanUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeSpanUnit MS
public static final TimeSpanUnit s
public static final TimeSpanUnit S
public static final TimeSpanUnit m
public static final TimeSpanUnit h
public static final TimeSpanUnit H
public static final TimeSpanUnit d
public static final TimeSpanUnit D
public static final TimeSpanUnit w
public static final TimeSpanUnit W
public static final TimeSpanUnit M
public static final TimeSpanUnit y
public static final TimeSpanUnit Y
public static TimeSpanUnit[] values()
for (TimeSpanUnit c : TimeSpanUnit.values()) System.out.println(c);
public static TimeSpanUnit valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getUnitName()
public long getUnitSpanInMilliSeconds()
public long toMilliSeconds(double value)
value
- how many parts of the TimeSpan Unitpublic String getUnitName(long value)
value
- getUnitName()