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"- Status:
- Stable ICU 53.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DAYS
DaysFRIDAYS
FridaysHOURS
HoursMINUTES
MinutesMONDAYS
MondaysMONTHS
MonthsQUARTERS
QuartersSATURDAYS
SaturdaysSECONDS
SecondsSUNDAYS
SundaysTHURSDAYS
ThursdaysTUESDAYS
TuesdaysWEDNESDAYS
WednesdaysWEEKS
WeeksYEARS
Years
-
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- Status:
- Stable ICU 53.
-
MINUTES
public static final RelativeDateTimeFormatter.RelativeUnit MINUTES
Minutes- Status:
- Stable ICU 53.
-
HOURS
public static final RelativeDateTimeFormatter.RelativeUnit HOURS
Hours- Status:
- Stable ICU 53.
-
DAYS
public static final RelativeDateTimeFormatter.RelativeUnit DAYS
Days- Status:
- Stable ICU 53.
-
WEEKS
public static final RelativeDateTimeFormatter.RelativeUnit WEEKS
Weeks- Status:
- Stable ICU 53.
-
MONTHS
public static final RelativeDateTimeFormatter.RelativeUnit MONTHS
Months- Status:
- Stable ICU 53.
-
YEARS
public static final RelativeDateTimeFormatter.RelativeUnit YEARS
Years- Status:
- Stable ICU 53.
-
QUARTERS
public static final RelativeDateTimeFormatter.RelativeUnit QUARTERS
Quarters- Status:
- Stable ICU 76.
-
SUNDAYS
public static final RelativeDateTimeFormatter.RelativeUnit SUNDAYS
Sundays- Status:
- Stable ICU 76.
-
MONDAYS
public static final RelativeDateTimeFormatter.RelativeUnit MONDAYS
Mondays- Status:
- Stable ICU 76.
-
TUESDAYS
public static final RelativeDateTimeFormatter.RelativeUnit TUESDAYS
Tuesdays- Status:
- Stable ICU 76.
-
WEDNESDAYS
public static final RelativeDateTimeFormatter.RelativeUnit WEDNESDAYS
Wednesdays- Status:
- Stable ICU 76.
-
THURSDAYS
public static final RelativeDateTimeFormatter.RelativeUnit THURSDAYS
Thursdays- Status:
- Stable ICU 76.
-
FRIDAYS
public static final RelativeDateTimeFormatter.RelativeUnit FRIDAYS
Fridays- Status:
- Stable ICU 76.
-
SATURDAYS
public static final RelativeDateTimeFormatter.RelativeUnit SATURDAYS
Saturdays- Status:
- Stable ICU 76.
-
-
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
-
-