Package com.ibm.icu.text
Enum RelativeDateTimeFormatter.RelativeUnit
- java.lang.Object
-
- java.lang.Enum<RelativeDateTimeFormatter.RelativeUnit>
-
- com.ibm.icu.text.RelativeDateTimeFormatter.RelativeUnit
-
- All Implemented Interfaces:
Serializable
,Comparable<RelativeDateTimeFormatter.RelativeUnit>
- Enclosing class:
- RelativeDateTimeFormatter
public static enum RelativeDateTimeFormatter.RelativeUnit extends Enum<RelativeDateTimeFormatter.RelativeUnit>
Represents the unit for formatting a relative date. e.g "in 5 days" or "in 3 months"
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RelativeDateTimeFormatter.RelativeUnit
valueOf(String name)
Returns the enum constant of this type with the specified name.static RelativeDateTimeFormatter.RelativeUnit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SECONDS
public static final RelativeDateTimeFormatter.RelativeUnit SECONDS
Seconds
-
MINUTES
public static final RelativeDateTimeFormatter.RelativeUnit MINUTES
Minutes
-
HOURS
public static final RelativeDateTimeFormatter.RelativeUnit HOURS
Hours
-
DAYS
public static final RelativeDateTimeFormatter.RelativeUnit DAYS
Days
-
WEEKS
public static final RelativeDateTimeFormatter.RelativeUnit WEEKS
Weeks
-
MONTHS
public static final RelativeDateTimeFormatter.RelativeUnit MONTHS
Months
-
YEARS
public static final RelativeDateTimeFormatter.RelativeUnit YEARS
Years
-
QUARTERS
@Deprecated public static final RelativeDateTimeFormatter.RelativeUnit QUARTERS
Deprecated.This API is ICU internal only.Quarters
-
-
Method Detail
-
values
public static RelativeDateTimeFormatter.RelativeUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RelativeDateTimeFormatter.RelativeUnit c : RelativeDateTimeFormatter.RelativeUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RelativeDateTimeFormatter.RelativeUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-