final class GJEraDateTimeField extends BaseDateTimeField
Modifier and Type | Field and Description |
---|---|
private BasicChronology |
iChronology |
private static long |
serialVersionUID
Serialization version
|
Constructor and Description |
---|
GJEraDateTimeField(BasicChronology chronology)
Restricted constructor
|
Modifier and Type | Method and Description |
---|---|
int |
get(long instant)
Get the Era component of the specified time instant.
|
java.lang.String |
getAsText(int fieldValue,
java.util.Locale locale)
Get the human-readable, text value of this field from the field value.
|
DurationField |
getDurationField()
Returns the duration per unit value of this field.
|
int |
getMaximumTextLength(java.util.Locale locale)
Get the maximum text value for this field.
|
int |
getMaximumValue()
Get the maximum allowable value for this field.
|
int |
getMinimumValue()
Get the minimum allowable value for this field.
|
DurationField |
getRangeDurationField()
Returns the range duration of this field.
|
boolean |
isLenient()
Returns true if the set method is lenient.
|
private java.lang.Object |
readResolve()
Serialization singleton
|
long |
roundCeiling(long instant)
Round to the highest whole unit of this field.
|
long |
roundFloor(long instant)
Round to the lowest whole unit of this field.
|
long |
roundHalfCeiling(long instant)
Round to the nearest whole unit of this field.
|
long |
roundHalfEven(long instant)
Round to the nearest whole unit of this field.
|
long |
roundHalfFloor(long instant)
Round to the nearest whole unit of this field.
|
long |
set(long instant,
int era)
Set the Era component of the specified time instant.
|
long |
set(long instant,
java.lang.String text,
java.util.Locale locale)
Sets a value in the milliseconds supplied from a human-readable, text value.
|
add, add, add, addWrapField, addWrapField, addWrapPartial, convertText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getDifference, getDifferenceAsLong, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getName, getType, isLeap, isSupported, remainder, set, set, set, toString
setExtended
private static final long serialVersionUID
private final BasicChronology iChronology
GJEraDateTimeField(BasicChronology chronology)
public boolean isLenient()
DateTimeField
isLenient
in class DateTimeField
public int get(long instant)
get
in class BaseDateTimeField
instant
- the time instant in millis to query.public java.lang.String getAsText(int fieldValue, java.util.Locale locale)
BaseDateTimeField
The default implementation returns Integer.toString(get(instant)).
Note: subclasses that override this method should also override getMaximumTextLength.
getAsText
in class BaseDateTimeField
fieldValue
- the numeric value to convert to textlocale
- the locale to use for selecting a text symbol, null for defaultpublic long set(long instant, int era)
set
in class BaseDateTimeField
instant
- the time instant in millis to update.era
- the era to update the time to.java.lang.IllegalArgumentException
- if era is invalid.public long set(long instant, java.lang.String text, java.util.Locale locale)
BaseDateTimeField
This implementation uses convertText(String, Locale)
and
BaseDateTimeField.set(long, int)
.
Note: subclasses that override this method should also override getAsText.
set
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to set intext
- the text value to setlocale
- the locale to use for selecting a text symbol, null for defaultpublic long roundFloor(long instant)
BaseDateTimeField
For example, a datetime of 2002-11-02T23:34:56.789, rounded to the lowest whole hour is 2002-11-02T23:00:00.000.
roundFloor
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundCeiling(long instant)
BaseDateTimeField
For example, a datetime of 2002-11-02T23:34:56.789, rounded to the highest whole hour is 2002-11-03T00:00:00.000.
The default implementation calls roundFloor, and if the instant is modified as a result, adds one field unit. Subclasses are encouraged to provide a more efficient implementation.
roundCeiling
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfFloor(long instant)
BaseDateTimeField
roundHalfFloor
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfCeiling(long instant)
BaseDateTimeField
roundHalfCeiling
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfEven(long instant)
BaseDateTimeField
If the millisecond value is exactly halfway between the floor and ceiling, the ceiling is chosen over the floor only if it makes this field's value even.
roundHalfEven
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to roundpublic DurationField getDurationField()
BaseDateTimeField
getDurationField
in class BaseDateTimeField
public DurationField getRangeDurationField()
BaseDateTimeField
getRangeDurationField
in class BaseDateTimeField
public int getMinimumValue()
BaseDateTimeField
getMinimumValue
in class BaseDateTimeField
public int getMaximumValue()
BaseDateTimeField
getMaximumValue
in class BaseDateTimeField
public int getMaximumTextLength(java.util.Locale locale)
BaseDateTimeField
getMaximumTextLength
in class BaseDateTimeField
locale
- the locale to use for selecting a text symbolprivate java.lang.Object readResolve()