public enum HDF5TimeUnit extends java.lang.Enum<HDF5TimeUnit>
TimeUnit
represents a unit of a time duration. Each unit corresponds to one time
duration HDF5DataTypeVariant
.
The conversion of time durations is heavily inspired by Doug Lea's class in the Java runtime library.
Enum Constant and Description |
---|
DAYS |
HOURS |
MICROSECONDS |
MILLISECONDS |
MINUTES |
SECONDS |
Modifier and Type | Method and Description |
---|---|
long |
convert(HDF5TimeDuration duration)
Convert the given time duration in the given unit to this unit.
|
long[] |
convert(HDF5TimeDuration[] durations)
Convert the given time durations to this unit.
|
long[] |
convert(HDF5TimeDurationArray durations)
Convert the given time durations in the given time unit to this unit.
|
HDF5TimeDurationMDArray |
convert(HDF5TimeDurationMDArray durations)
Convert the given time durations in the given time unit to this unit.
|
long[] |
convert(long[] durations,
HDF5TimeUnit unit)
Convert the given time durations in the given time unit to this unit.
|
long |
convert(long duration,
HDF5TimeUnit unit)
Convert the given time duration in the given unit to this unit.
|
HDF5DataTypeVariant |
getTypeVariant()
Returns the type variant corresponding to this unit.
|
static HDF5TimeUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HDF5TimeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HDF5TimeUnit MICROSECONDS
public static final HDF5TimeUnit MILLISECONDS
public static final HDF5TimeUnit SECONDS
public static final HDF5TimeUnit MINUTES
public static final HDF5TimeUnit HOURS
public static final HDF5TimeUnit DAYS
public static HDF5TimeUnit[] values()
for (HDF5TimeUnit c : HDF5TimeUnit.values()) System.out.println(c);
public static HDF5TimeUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic HDF5DataTypeVariant getTypeVariant()
public long convert(long duration, HDF5TimeUnit unit)
Long.MIN_VALUE
if negative or Long.MAX_VALUE
if positive.duration
- The time duration in the given unit
.unit
- The unit of the duration
argument.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.public long[] convert(HDF5TimeDurationArray durations)
Long.MIN_VALUE
if negative or Long.MAX_VALUE
if
positive.durations
- The time durations.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.public HDF5TimeDurationMDArray convert(HDF5TimeDurationMDArray durations)
Long.MIN_VALUE
if negative or Long.MAX_VALUE
if
positive.durations
- The time durations.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.public long[] convert(long[] durations, HDF5TimeUnit unit)
Long.MIN_VALUE
if negative or Long.MAX_VALUE
if
positive.durations
- The time duration in the given unit
.unit
- The unit of the duration
argument.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.public long convert(HDF5TimeDuration duration)
Long.MIN_VALUE
if negative or Long.MAX_VALUE
if positive.duration
- The time duration and its unit.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.public long[] convert(HDF5TimeDuration[] durations)
Long.MIN_VALUE
if negative
or Long.MAX_VALUE
if positive.Long.MIN_VALUE
if conversion
would negatively overflow, or Long.MAX_VALUE
if it would positively
overflow.