private static class GJChronology.LinkedDurationField extends DecoratedDurationField
Modifier and Type | Field and Description |
---|---|
private GJChronology.ImpreciseCutoverField |
iField |
private static long |
serialVersionUID |
Constructor and Description |
---|
LinkedDurationField(DurationField durationField,
GJChronology.ImpreciseCutoverField dateTimeField) |
Modifier and Type | Method and Description |
---|---|
long |
add(long instant,
int value)
Adds a duration value (which may be negative) to the instant.
|
long |
add(long instant,
long value)
Adds a duration value (which may be negative) to the instant.
|
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.
|
getMillis, getMillis, getUnitMillis, getValueAsLong, getWrappedField, isPrecise
compareTo, getMillis, getMillis, getName, getType, getValue, getValue, getValueAsLong, isSupported, toString
subtract, subtract
private static final long serialVersionUID
private final GJChronology.ImpreciseCutoverField iField
LinkedDurationField(DurationField durationField, GJChronology.ImpreciseCutoverField dateTimeField)
public long add(long instant, int value)
DurationField
add
in class DecoratedDurationField
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)
DurationField
add
in class DecoratedDurationField
instant
- the milliseconds from 1970-01-01T00:00:00Z to add tovalue
- the value to add, in the units of the fieldpublic int getDifference(long minuendInstant, long subtrahendInstant)
DurationField
long instant = ... int v = ... int age = getDifference(add(instant, v), instant);The value 'age' is the same as the value 'v'.
getDifference
in class BaseDurationField
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)
DurationField
long instant = ... long v = ... long age = getDifferenceAsLong(add(instant, v), instant);The value 'age' is the same as the value 'v'.
getDifferenceAsLong
in class DecoratedDurationField
minuendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract fromsubtrahendInstant
- the milliseconds from 1970-01-01T00:00:00Z to
subtract off the minuend