private final class GJChronology.ImpreciseCutoverField extends GJChronology.CutoverField
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
iConvertByWeekyear, iCutover, iDurationField, iGregorianField, iJulianField, iRangeDurationField
Constructor and Description |
---|
ImpreciseCutoverField(DateTimeField julianField,
DateTimeField gregorianField,
DurationField durationField,
DurationField rangeDurationField,
long cutoverMillis)
Uses shared duration fields rather than creating a new one.
|
ImpreciseCutoverField(DateTimeField julianField,
DateTimeField gregorianField,
DurationField durationField,
long cutoverMillis)
Uses a shared duration field rather than creating a new one.
|
ImpreciseCutoverField(DateTimeField julianField,
DateTimeField gregorianField,
DurationField durationField,
long cutoverMillis,
boolean convertByWeekyear)
Uses a shared duration field rather than creating a new one.
|
ImpreciseCutoverField(DateTimeField julianField,
DateTimeField gregorianField,
long cutoverMillis)
Creates a duration field that links back to this.
|
Modifier and Type | Method and Description |
---|---|
long |
add(long instant,
int value)
Adds a value (which may be negative) to the instant value,
overflowing into larger fields if necessary.
|
long |
add(long instant,
long value)
Adds a value (which may be negative) to the instant value,
overflowing into larger fields if necessary.
|
int |
getDifference(long minuendInstant,
long subtrahendInstant)
Computes the difference between two instants, as measured in the units
of this field.
|
long |
getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
Computes the difference between two instants, as measured in the units
of this field.
|
int |
getMaximumValue(long instant)
Get the maximum value for this field evaluated at the specified time.
|
int |
getMinimumValue(long instant)
Get the minimum value for this field evaluated at the specified time.
|
add, get, getAsShortText, getAsShortText, getAsText, getAsText, getDurationField, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getRangeDurationField, gregorianToJulian, isLeap, isLenient, julianToGregorian, roundCeiling, roundFloor, set, set
addWrapField, addWrapField, addWrapPartial, convertText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getName, getType, isSupported, remainder, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, toString
setExtended
private static final long serialVersionUID
ImpreciseCutoverField(DateTimeField julianField, DateTimeField gregorianField, long cutoverMillis)
ImpreciseCutoverField(DateTimeField julianField, DateTimeField gregorianField, DurationField durationField, long cutoverMillis)
durationField
- shared duration fieldImpreciseCutoverField(DateTimeField julianField, DateTimeField gregorianField, DurationField durationField, DurationField rangeDurationField, long cutoverMillis)
durationField
- shared duration fieldImpreciseCutoverField(DateTimeField julianField, DateTimeField gregorianField, DurationField durationField, long cutoverMillis, boolean convertByWeekyear)
durationField
- shared duration fieldpublic long add(long instant, int value)
BaseDateTimeField
The value will be added to this field. If the value is too large to be added solely to this field, larger fields will increase as required. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.
For example, in the ISO chronology:
2000-08-20 add six months is 2001-02-20
2000-08-20 add twenty months is 2002-04-20
2000-08-20 add minus nine months is 1999-11-20
2001-01-31 add one month is 2001-02-28
2001-01-31 add two months is 2001-03-31
add
in class GJChronology.CutoverField
instant
- the milliseconds from 1970-01-01T00:00:00Z to add tovalue
- the value to add, in the units of the fieldpublic long add(long instant, long value)
BaseDateTimeField
add
in class GJChronology.CutoverField
instant
- the milliseconds from 1970-01-01T00:00:00Z to add tovalue
- the long value to add, in the units of the fieldBaseDateTimeField.add(long,int)
public int getDifference(long minuendInstant, long subtrahendInstant)
BaseDateTimeField
long instant = ... int v = ... int age = getDifference(add(instant, v), instant);The value 'age' is the same as the value 'v'.
getDifference
in class GJChronology.CutoverField
minuendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendpublic long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)
BaseDateTimeField
long instant = ... long v = ... long age = getDifferenceAsLong(add(instant, v), instant);The value 'age' is the same as the value 'v'.
getDifferenceAsLong
in class GJChronology.CutoverField
minuendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuendpublic int getMinimumValue(long instant)
BaseDateTimeField
This implementation returns the same as BaseDateTimeField.getMinimumValue()
.
getMinimumValue
in class GJChronology.CutoverField
instant
- the milliseconds from 1970-01-01T00:00:00Z to querypublic int getMaximumValue(long instant)
BaseDateTimeField
This implementation returns the same as BaseDateTimeField.getMaximumValue()
.
getMaximumValue
in class GJChronology.CutoverField
instant
- the milliseconds from 1970-01-01T00:00:00Z to query