Added in API level 24

Field


open class Field : Format.Field
kotlin.Any
   ↳ java.text.AttributedCharacterIterator.Attribute
   ↳ java.text.Format.Field
   ↳ android.icu.text.DateFormat.Field

The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that DateFormat.formatToCharacterIterator() method returns.

There is no public constructor to this class, the only instances are the constants defined here.

Summary

Protected constructors
Field(name: String!, calendarField: Int)

Constructs a DateFormat.Field with the given name and the Calendar field which this attribute represents.

Public methods
open Int

Returns the Calendar field associated with this attribute.

open static DateFormat.Field!
ofCalendarField(calendarField: Int)

Returns the Field constant that corresponds to the Calendar field calendarField.

Protected methods
open Any!

Resolves instances being deserialized to the predefined constants.

Properties
static DateFormat.Field!

Constant identifying the time of day indicator(am/pm).

static DateFormat.Field!

[icu] Constant identifying the am/pm/midnight/noon field.

static DateFormat.Field!

Constant identifying the day of month field.

static DateFormat.Field!

Constant identifying the day of week field.

static DateFormat.Field!

Constant identifying the day of week in month field.

static DateFormat.Field!

Constant identifying the day of year field.

static DateFormat.Field!

Constant identifying the local day of week field.

static DateFormat.Field!

Constant identifying the era field.

static DateFormat.Field!

Constant identifying the extended year field.

static DateFormat.Field!

[icu] Constant identifying the flexible day period field.

static DateFormat.Field!

Constant identifying the hour(0-11) field.

static DateFormat.Field!

Constant identifying the hour(1-12) field.

static DateFormat.Field!

Constant identifying the hour(0-23) of day field.

static DateFormat.Field!

Constant identifying the hour(1-24) of day field.

static DateFormat.Field!

Constant identifying the Julian day field.

static DateFormat.Field!

Constant identifying the millisecond field.

static DateFormat.Field!

Constant identifying the milliseconds in day field.

static DateFormat.Field!

Constant identifying the minute field.

static DateFormat.Field!

Constant identifying the month field.

static DateFormat.Field!

Constant identifying the quarter field.

static DateFormat.Field!

Constant identifying the second field.

static DateFormat.Field!

Constant identifying the time zone field.

static DateFormat.Field!

Constant identifying the week of month field.

static DateFormat.Field!

Constant identifying the week of year field.

static DateFormat.Field!

Constant identifying the year field.

static DateFormat.Field!

Constant identifying the year used with week of year field.

Protected constructors

Field

Added in API level 24
protected Field(
    name: String!,
    calendarField: Int)

Constructs a DateFormat.Field with the given name and the Calendar field which this attribute represents. Use -1 for calendarField if this field does not have a corresponding Calendar field.

Parameters
name String!: Name of the attribute
calendarField Int: Calendar field constant

Public methods

getCalendarField

Added in API level 24
open fun getCalendarField(): Int

Returns the Calendar field associated with this attribute. If there is no corresponding Calendar available, this will return -1.

Return
Int Calendar constant for this attribute.

ofCalendarField

Added in API level 24
open static fun ofCalendarField(calendarField: Int): DateFormat.Field!

Returns the Field constant that corresponds to the Calendar field calendarField. If there is no corresponding Field is available, null is returned.

Parameters
calendarField Int: Calendar field constant
Return
DateFormat.Field! Field associated with the calendarField, or null if no associated Field is available.
Exceptions
java.lang.IllegalArgumentException if calendarField is not a valid Calendar field constant.

Protected methods

readResolve

Added in API level 24
protected open fun readResolve(): Any!

Resolves instances being deserialized to the predefined constants.

Return
Any! the resolved Attribute object
Exceptions
java.io.InvalidObjectException if the constant could not be resolved.

Properties

AM_PM

Added in API level 24
static val AM_PM: DateFormat.Field!

Constant identifying the time of day indicator(am/pm).

AM_PM_MIDNIGHT_NOON

Added in API level 28
static val AM_PM_MIDNIGHT_NOON: DateFormat.Field!

[icu] Constant identifying the am/pm/midnight/noon field.

DAY_OF_MONTH

Added in API level 24
static val DAY_OF_MONTH: DateFormat.Field!

Constant identifying the day of month field.

DAY_OF_WEEK

Added in API level 24
static val DAY_OF_WEEK: DateFormat.Field!

Constant identifying the day of week field.

DAY_OF_WEEK_IN_MONTH

Added in API level 24
static val DAY_OF_WEEK_IN_MONTH: DateFormat.Field!

Constant identifying the day of week in month field.

DAY_OF_YEAR

Added in API level 24
static val DAY_OF_YEAR: DateFormat.Field!

Constant identifying the day of year field.

DOW_LOCAL

Added in API level 24
static val DOW_LOCAL: DateFormat.Field!

Constant identifying the local day of week field.

ERA

Added in API level 24
static val ERA: DateFormat.Field!

Constant identifying the era field.

EXTENDED_YEAR

Added in API level 24
static val EXTENDED_YEAR: DateFormat.Field!

Constant identifying the extended year field.

FLEXIBLE_DAY_PERIOD

Added in API level 28
static val FLEXIBLE_DAY_PERIOD: DateFormat.Field!

[icu] Constant identifying the flexible day period field.

HOUR0

Added in API level 24
static val HOUR0: DateFormat.Field!

Constant identifying the hour(0-11) field.

HOUR1

Added in API level 24
static val HOUR1: DateFormat.Field!

Constant identifying the hour(1-12) field.

HOUR_OF_DAY0

Added in API level 24
static val HOUR_OF_DAY0: DateFormat.Field!

Constant identifying the hour(0-23) of day field.

HOUR_OF_DAY1

Added in API level 24
static val HOUR_OF_DAY1: DateFormat.Field!

Constant identifying the hour(1-24) of day field.

JULIAN_DAY

Added in API level 24
static val JULIAN_DAY: DateFormat.Field!

Constant identifying the Julian day field.

MILLISECOND

Added in API level 24
static val MILLISECOND: DateFormat.Field!

Constant identifying the millisecond field.

MILLISECONDS_IN_DAY

Added in API level 24
static val MILLISECONDS_IN_DAY: DateFormat.Field!

Constant identifying the milliseconds in day field.

MINUTE

Added in API level 24
static val MINUTE: DateFormat.Field!

Constant identifying the minute field.

MONTH

Added in API level 24
static val MONTH: DateFormat.Field!

Constant identifying the month field.

QUARTER

Added in API level 24
static val QUARTER: DateFormat.Field!

Constant identifying the quarter field.

SECOND

Added in API level 24
static val SECOND: DateFormat.Field!

Constant identifying the second field.

TIME_ZONE

Added in API level 24
static val TIME_ZONE: DateFormat.Field!

Constant identifying the time zone field.

WEEK_OF_MONTH

Added in API level 24
static val WEEK_OF_MONTH: DateFormat.Field!

Constant identifying the week of month field.

WEEK_OF_YEAR

Added in API level 24
static val WEEK_OF_YEAR: DateFormat.Field!

Constant identifying the week of year field.

YEAR

Added in API level 24
static val YEAR: DateFormat.Field!

Constant identifying the year field.

YEAR_WOY

Added in API level 24
static val YEAR_WOY: DateFormat.Field!

Constant identifying the year used with week of year field.