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, toStringsetExtendedprivate static final long serialVersionUID
private final BasicChronology iChronology
GJEraDateTimeField(BasicChronology chronology)
public boolean isLenient()
DateTimeFieldisLenient in class DateTimeFieldpublic int get(long instant)
get in class BaseDateTimeFieldinstant - the time instant in millis to query.public java.lang.String getAsText(int fieldValue,
java.util.Locale locale)
BaseDateTimeFieldThe default implementation returns Integer.toString(get(instant)).
Note: subclasses that override this method should also override getMaximumTextLength.
getAsText in class BaseDateTimeFieldfieldValue - 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 BaseDateTimeFieldinstant - 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 BaseDateTimeFieldinstant - 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)
BaseDateTimeFieldFor 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 BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundCeiling(long instant)
BaseDateTimeFieldFor 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 BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfFloor(long instant)
BaseDateTimeFieldroundHalfFloor in class BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfCeiling(long instant)
BaseDateTimeFieldroundHalfCeiling in class BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic long roundHalfEven(long instant)
BaseDateTimeFieldIf 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 BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic DurationField getDurationField()
BaseDateTimeFieldgetDurationField in class BaseDateTimeFieldpublic DurationField getRangeDurationField()
BaseDateTimeFieldgetRangeDurationField in class BaseDateTimeFieldpublic int getMinimumValue()
BaseDateTimeFieldgetMinimumValue in class BaseDateTimeFieldpublic int getMaximumValue()
BaseDateTimeFieldgetMaximumValue in class BaseDateTimeFieldpublic int getMaximumTextLength(java.util.Locale locale)
BaseDateTimeFieldgetMaximumTextLength in class BaseDateTimeFieldlocale - the locale to use for selecting a text symbolprivate java.lang.Object readResolve()