public enum SimpleUnit extends Enum<SimpleUnit> implements TemporalUnit
Enum Constant and Description |
---|
BILLION
A granularity representing one billion milliseconds.
|
BILLION_HUNDRED
A granularity representing one hundred billion milliseconds.
|
BILLION_TEN
A granularity representing ten billion milliseconds.
|
HUNDRED
A granularity representing one hundred milliseconds.
|
MILLION
A granularity representing one million milliseconds.
|
MILLION_HUNDRED
A granularity representing one hundred million milliseconds.
|
MILLION_TEN
A granularity representing ten million milliseconds.
|
ONE
A granularity representing one millisecond.
|
TEN
A granularity representing ten milliseconds.
|
THOUSAND
A granularity representing one thousand milliseconds.
|
THOUSAND_HUNDRED
A granularity representing one hundred thousand milliseconds.
|
THOUSAND_TEN
A granularity representing ten thousand milliseconds.
|
TRILLION
A granularity representing one trillion milliseconds.
|
Modifier and Type | Method and Description |
---|---|
<R extends Temporal> |
addTo(R temporal,
long periodToAdd) |
long |
between(Temporal t1,
Temporal t2) |
long |
decrement(long time)
Decrements the given number of milliseconds with the milliseconds
represented by the enumerator value.
|
Duration |
getDuration() |
long |
getMillis()
Returns the number of milliseconds represented by the granularity.
|
long |
increment(long time)
Increments the given number of milliseconds with the milliseconds
represented by the enumerator value.
|
boolean |
isDateBased() |
boolean |
isDurationEstimated() |
boolean |
isSupportedBy(Temporal temporal) |
boolean |
isTimeBased() |
long |
truncate(long time)
Truncates the given time point by rounding it down to the nearest
multitude of the milliseconds represented by the granularity value.
|
static SimpleUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SimpleUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, toString, wait, wait, wait
toString
public static final SimpleUnit ONE
public static final SimpleUnit TEN
public static final SimpleUnit HUNDRED
public static final SimpleUnit THOUSAND
public static final SimpleUnit THOUSAND_TEN
public static final SimpleUnit THOUSAND_HUNDRED
public static final SimpleUnit MILLION
public static final SimpleUnit MILLION_TEN
public static final SimpleUnit MILLION_HUNDRED
public static final SimpleUnit BILLION
public static final SimpleUnit BILLION_TEN
public static final SimpleUnit BILLION_HUNDRED
public static final SimpleUnit TRILLION
public static SimpleUnit[] values()
for (SimpleUnit c : SimpleUnit.values()) System.out.println(c);
public static SimpleUnit 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 long increment(long time)
time
- the time to incrementpublic long decrement(long time)
time
- the time to incrementpublic long truncate(long time)
THOUSAND
would adjust the time point
4366 to 4000.time
- the time that needs adjustmentpublic long getMillis()
public <R extends Temporal> R addTo(R temporal, long periodToAdd)
addTo
in interface TemporalUnit
public long between(Temporal t1, Temporal t2)
between
in interface TemporalUnit
public Duration getDuration()
getDuration
in interface TemporalUnit
public boolean isDateBased()
isDateBased
in interface TemporalUnit
public boolean isDurationEstimated()
isDurationEstimated
in interface TemporalUnit
public boolean isSupportedBy(Temporal temporal)
isSupportedBy
in interface TemporalUnit
public boolean isTimeBased()
isTimeBased
in interface TemporalUnit
Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.