Enum RelativeDateTimeFormatter.RelativeDateTimeUnit
java.lang.Object
java.lang.Enum<RelativeDateTimeFormatter.RelativeDateTimeUnit>
com.ibm.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit
- All Implemented Interfaces:
Serializable, Comparable<RelativeDateTimeFormatter.RelativeDateTimeUnit>
- Enclosing class:
RelativeDateTimeFormatter
public static enum RelativeDateTimeFormatter.RelativeDateTimeUnit
extends Enum<RelativeDateTimeFormatter.RelativeDateTimeUnit>
Represents the unit for formatting a relative date. e.g "in 5 days" or "next year"
- Status:
- Stable ICU 57.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSpecifies that relative unit is day, e.g.Specifies that relative unit is Friday, e.g.Specifies that relative unit is hour, e.g. "1 hour ago", "in 5 hours".Specifies that relative unit is minute, e.g. "1 minute ago", "in 5 minutes".Specifies that relative unit is Monday, e.g.Specifies that relative unit is month, e.g.Specifies that relative unit is quarter, e.g.Specifies that relative unit is Saturday, e.g.Specifies that relative unit is second, e.g. "1 second ago", "in 5 seconds".Specifies that relative unit is Sunday, e.g.Specifies that relative unit is Thursday, e.g.Specifies that relative unit is Tuesday, e.g.Specifies that relative unit is Wednesday, e.g.Specifies that relative unit is week, e.g.Specifies that relative unit is year, e.g. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this type with the specified name.values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
YEAR
Specifies that relative unit is year, e.g. "last year", "in 5 years".- Status:
- Stable ICU 57.
-
QUARTER
Specifies that relative unit is quarter, e.g. "last quarter", "in 5 quarters".- Status:
- Stable ICU 57.
-
MONTH
Specifies that relative unit is month, e.g. "last month", "in 5 months".- Status:
- Stable ICU 57.
-
WEEK
Specifies that relative unit is week, e.g. "last week", "in 5 weeks".- Status:
- Stable ICU 57.
-
DAY
Specifies that relative unit is day, e.g. "yesterday", "in 5 days".- Status:
- Stable ICU 57.
-
HOUR
Specifies that relative unit is hour, e.g. "1 hour ago", "in 5 hours".- Status:
- Stable ICU 57.
-
MINUTE
Specifies that relative unit is minute, e.g. "1 minute ago", "in 5 minutes".- Status:
- Stable ICU 57.
-
SECOND
Specifies that relative unit is second, e.g. "1 second ago", "in 5 seconds".- Status:
- Stable ICU 57.
-
SUNDAY
Specifies that relative unit is Sunday, e.g. "last Sunday", "this Sunday", "next Sunday", "in 5 Sundays".- Status:
- Stable ICU 57.
-
MONDAY
Specifies that relative unit is Monday, e.g. "last Monday", "this Monday", "next Monday", "in 5 Mondays".- Status:
- Stable ICU 57.
-
TUESDAY
Specifies that relative unit is Tuesday, e.g. "last Tuesday", "this Tuesday", "next Tuesday", "in 5 Tuesdays".- Status:
- Stable ICU 57.
-
WEDNESDAY
Specifies that relative unit is Wednesday, e.g. "last Wednesday", "this Wednesday", "next Wednesday", "in 5 Wednesdays".- Status:
- Stable ICU 57.
-
THURSDAY
Specifies that relative unit is Thursday, e.g. "last Thursday", "this Thursday", "next Thursday", "in 5 Thursdays".- Status:
- Stable ICU 57.
-
FRIDAY
Specifies that relative unit is Friday, e.g. "last Friday", "this Friday", "next Friday", "in 5 Fridays".- Status:
- Stable ICU 57.
-
SATURDAY
Specifies that relative unit is Saturday, e.g. "last Saturday", "this Saturday", "next Saturday", "in 5 Saturdays".- Status:
- Stable ICU 57.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-