Top Description Fields Constructors Methods
com.ibm.icu.impl.duration

public final Class TimeUnit

extends Object
Class Inheritance

'Enum' for individual time units. Not an actual enum so that it can be used by Java 1.4.

Field Summary

Modifier and TypeField and Description
pack-priv static final long[]
approxDurations

Approximate, durations for the units independent of the time at which they are measured

public static final TimeUnit
DAY

Represents a day.

public static final TimeUnit
HOUR

Represents an hour.

public static final TimeUnit
MILLISECOND

Represents a millisecond.

public static final TimeUnit
MINUTE

Represents a minute.

public static final TimeUnit
MONTH

Represents a month.

pack-priv final String
name

The name of this unit, a key, not for localization.

pack-priv final byte
ordinal

The ordinal of the unit, in order from largest to smallest.

public static final TimeUnit
SECOND

Represents a second.

pack-priv static final TimeUnit[]
units

The list of units, in order from largest to smallest.

public static final TimeUnit
WEEK

Represents a week.

public static final TimeUnit
YEAR

Represents a year.

Constructor Summary

AccessConstructor and Description
private
TimeUnit(String name, int ordinal)

Private constructor

Method Summary

Modifier and TypeMethod and Description
public TimeUnit
larger()

Returns the next larger time unit, or null if this is the largest.

public int
ordinal()

Returns the ordinal value of this time unit, largest is 0.

public TimeUnit
smaller()

Returns the next smaller time unit, or null if this is the smallest.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

approxDurationsback to summary
pack-priv static final long[] approxDurations

Approximate, durations for the units independent of the time at which they are measured

DAYback to summary
public static final TimeUnit DAY

Represents a day.

HOURback to summary
public static final TimeUnit HOUR

Represents an hour.

MILLISECONDback to summary
public static final TimeUnit MILLISECOND

Represents a millisecond.

MINUTEback to summary
public static final TimeUnit MINUTE

Represents a minute.

MONTHback to summary
public static final TimeUnit MONTH

Represents a month.

nameback to summary
pack-priv final String name

The name of this unit, a key, not for localization.

ordinalback to summary
pack-priv final byte ordinal

The ordinal of the unit, in order from largest to smallest.

SECONDback to summary
public static final TimeUnit SECOND

Represents a second.

unitsback to summary
pack-priv static final TimeUnit[] units

The list of units, in order from largest to smallest.

WEEKback to summary
public static final TimeUnit WEEK

Represents a week.

YEARback to summary
public static final TimeUnit YEAR

Represents a year.

Constructor Detail

TimeUnitback to summary
private TimeUnit(String name, int ordinal)

Private constructor

Method Detail

largerback to summary
public TimeUnit larger()

Returns the next larger time unit, or null if this is the largest.

ordinalback to summary
public int ordinal()

Returns the ordinal value of this time unit, largest is 0.

smallerback to summary
public TimeUnit smaller()

Returns the next smaller time unit, or null if this is the smallest.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override