Package com.ibm.icu.text
Enum RelativeDateTimeFormatter.RelativeDateTimeUnit
java.lang.Object
java.lang.Enum<RelativeDateTimeFormatter.RelativeDateTimeUnit>
com.ibm.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit
- All Implemented Interfaces:
Serializable
,Comparable<RelativeDateTimeFormatter.RelativeDateTimeUnit>
,java.lang.constant.Constable
- 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"
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
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". -
QUARTER
Specifies that relative unit is quarter, e.g. "last quarter", "in 5 quarters". -
MONTH
Specifies that relative unit is month, e.g. "last month", "in 5 months". -
WEEK
Specifies that relative unit is week, e.g. "last week", "in 5 weeks". -
DAY
Specifies that relative unit is day, e.g. "yesterday", "in 5 days". -
HOUR
Specifies that relative unit is hour, e.g. "1 hour ago", "in 5 hours". -
MINUTE
Specifies that relative unit is minute, e.g. "1 minute ago", "in 5 minutes". -
SECOND
Specifies that relative unit is second, e.g. "1 second ago", "in 5 seconds". -
SUNDAY
Specifies that relative unit is Sunday, e.g. "last Sunday", "this Sunday", "next Sunday", "in 5 Sundays". -
MONDAY
Specifies that relative unit is Monday, e.g. "last Monday", "this Monday", "next Monday", "in 5 Mondays". -
TUESDAY
Specifies that relative unit is Tuesday, e.g. "last Tuesday", "this Tuesday", "next Tuesday", "in 5 Tuesdays". -
WEDNESDAY
Specifies that relative unit is Wednesday, e.g. "last Wednesday", "this Wednesday", "next Wednesday", "in 5 Wednesdays". -
THURSDAY
Specifies that relative unit is Thursday, e.g. "last Thursday", "this Thursday", "next Thursday", "in 5 Thursdays". -
FRIDAY
Specifies that relative unit is Friday, e.g. "last Friday", "this Friday", "next Friday", "in 5 Fridays". -
SATURDAY
Specifies that relative unit is Saturday, e.g. "last Saturday", "this Saturday", "next Saturday", "in 5 Saturdays".
-
-
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
-