name
name: (TimeUnit) -> stringThe constant's name as declared.
TimeUnit.valueOf(…)
TimeUnit.NANOSECONDS
TimeUnit.MICROSECONDS| Method | Returns | Description |
|---|---|---|
name() | string | The constant's name as declared. |
ordinal() | number | The constant's 0-based position in values(). |
toString() | string | The constant's printed name; tostring(c) answers the same. |
compareTo(TimeUnit) | number | This ordinal less other's. |
equals(any) | boolean | Whether other is this constant. == answers the same. |
toNanos(number) | number | duration of this unit in nanoseconds. |
toMicros(number) | number | duration of this unit in microseconds. |
toMillis(number) | number | duration of this unit in milliseconds. |
toSeconds(number) | number | duration of this unit in seconds. |
toMinutes(number) | number | duration of this unit in minutes. |
toHours(number) | number | duration of this unit in hours. |
toDays(number) | number | duration of this unit in days. |
convert(number, TimeUnit) | number | sourceDuration of sourceUnit in this unit. |
toChronoUnit() | ChronoUnit | The ChronoUnit of the same length. |
values() | {TimeUnit} | Every constant in ordinal order, as a new 1-based array. |
valueOf(string) | TimeUnit | The constant named name; any other name is an error. |
| Method | Returns | Description |
|---|---|---|
TimeUnitClass.valueOf | TimeUnit | The constant named name; any other name is an error. |
TimeUnitClass.values | {TimeUnit} | Every constant in ordinal order, as a new 1-based array. |
namename: (TimeUnit) -> stringThe constant's name as declared.
ordinalordinal: (TimeUnit) -> numberThe constant's 0-based position in values().
toStringtoString: (TimeUnit) -> stringThe constant's printed name; tostring(c) answers the same.
compareTocompareTo: (TimeUnit, TimeUnit) -> numberThis ordinal less other's.
equalsequals: (TimeUnit, any) -> booleanWhether other is this constant. == answers the same.
toNanostoNanos: (TimeUnit, number) -> numberduration of this unit in nanoseconds.
toMicrostoMicros: (TimeUnit, number) -> numberduration of this unit in microseconds.
toMillistoMillis: (TimeUnit, number) -> numberduration of this unit in milliseconds.
toSecondstoSeconds: (TimeUnit, number) -> numberduration of this unit in seconds.
toMinutestoMinutes: (TimeUnit, number) -> numberduration of this unit in minutes.
toHourstoHours: (TimeUnit, number) -> numberduration of this unit in hours.
toDaystoDays: (TimeUnit, number) -> numberduration of this unit in days.
convertconvert: (TimeUnit, number, TimeUnit) -> numbersourceDuration of sourceUnit in this unit.
toChronoUnittoChronoUnit: (TimeUnit) -> ChronoUnitThe ChronoUnit of the same length.
valuesvalues: () -> {TimeUnit}Every constant in ordinal order, as a new 1-based array.
valueOfvalueOf: (string) -> TimeUnitThe constant named name; any other name is an error.