java.text
public
static
class
java.text.DateFormat.Field
The instances of this inner class are used as attribute keys and values
in AttributedCharacterIterator that
SimpleDateFormat.formatToCharacterIterator() method returns.
There is no public constructor to this class, the only instances are the
constants defined here.
Summary
Constants
Protected Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
Marks the time indicator part of a date.
public
static
final
DateFormat.Field
DAY_OF_MONTH
Marks the day of the month part of a date.
Marks the day of the week part of a date.
public
static
final
DateFormat.Field
DAY_OF_WEEK_IN_MONTH
Marks the day of the week in the month part of a date.
Marks the day of the year part of a date.
Marks the era part of a date.
Marks the hour part of a date (0-11).
Marks the hour part of a date (1-12).
public
static
final
DateFormat.Field
HOUR_OF_DAY0
Marks the hour of the day part of a date (0-11).
public
static
final
DateFormat.Field
HOUR_OF_DAY1
Marks the hour of the day part of a date (1-12).
Marks the millisecond part of a time.
Marks the minute part of a time.
Marks the month part of a date.
Marks the second part of a time.
Marks the time zone part of a date.
public
static
final
DateFormat.Field
WEEK_OF_MONTH
Marks the week of the month part of a date.
public
static
final
DateFormat.Field
WEEK_OF_YEAR
Marks the week of the year part of a date.
Marks the year part of a date.
Protected Constructors
protected
DateFormat.Field(String fieldName, int calendarField)
Constructs a new instance of DateFormat.Field with the given
fieldName and calendar field.
Parameters
fieldName
| The field name. |
calendarField
| the calender field type of the field.
|
Public Methods
public
int
getCalendarField()
Returns the Calendar field this Field represents
public
static
DateFormat.Field
ofCalendarField(int calendarField)
Returns the DateFormat.Field instance for the given calendar field
Parameters
calendarField
| a calendar field constant |
Returns
- null if there is no Field for this calendar field
Protected Methods
protected
Object
readResolve()
Serialization method resolve instances to the constant
DateFormat.Field values