final class BasicWeekyearDateTimeField extends ImpreciseDateTimeField
| Modifier and Type | Field and Description |
|---|---|
private BasicChronology |
iChronology |
private static long |
serialVersionUID |
private static long |
WEEK_53 |
| Constructor and Description |
|---|
BasicWeekyearDateTimeField(BasicChronology chronology)
Restricted constructor
|
| Modifier and Type | Method and Description |
|---|---|
long |
add(long instant,
int years)
Add the specified years to the specified time instant.
|
long |
add(long instant,
long value)
Adds a value (which may be negative) to the instant value,
overflowing into larger fields if necessary.
|
long |
addWrapField(long instant,
int years)
Add to the year component of the specified time instant
wrapping around within that component if necessary.
|
int |
get(long instant)
Get the Year of a week based year component of the specified time instant.
|
long |
getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
Computes the difference between two instants, as measured in the units
of this field.
|
int |
getLeapAmount(long instant)
Gets the amount by which this field is 'leap' for the specified instant.
|
DurationField |
getLeapDurationField()
If this field were to leap, then it would be in units described by the
returned duration.
|
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 |
isLeap(long instant)
Returns whether this field is 'leap' for the specified instant.
|
boolean |
isLenient()
Returns true if the set method is lenient.
|
private java.lang.Object |
readResolve()
Serialization singleton
|
long |
remainder(long instant)
Returns the fractional duration milliseconds of this field.
|
long |
roundFloor(long instant)
Round to the lowest whole unit of this field.
|
long |
set(long instant,
int year)
Set the Year of a week based year component of the specified time instant.
|
getDifference, getDurationField, getDurationUnitMillisadd, addWrapField, addWrapPartial, convertText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getAsText, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getName, getType, isSupported, roundCeiling, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, set, toStringsetExtendedprivate static final long serialVersionUID
private static final long WEEK_53
private final BasicChronology iChronology
BasicWeekyearDateTimeField(BasicChronology chronology)
public boolean isLenient()
DateTimeFieldisLenient in class DateTimeFieldpublic int get(long instant)
get in class ImpreciseDateTimeFieldinstant - the time instant in millis to query.DateTimeField.get(long)public long add(long instant,
int years)
add in class ImpreciseDateTimeFieldinstant - the time instant in millis to update.years - the years to add (can be negative).DateTimeField.add(long, int)public long add(long instant,
long value)
BaseDateTimeFieldadd in class ImpreciseDateTimeFieldinstant - 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 long addWrapField(long instant,
int years)
addWrapField in class BaseDateTimeFieldinstant - the time instant in millis to update.years - the years to add (can be negative).DateTimeField.addWrapField(long, int)public long getDifferenceAsLong(long minuendInstant,
long subtrahendInstant)
ImpreciseDateTimeFieldlong instant = ... long v = ... long age = getDifferenceAsLong(add(instant, v), instant);The value 'age' is the same as the value 'v'.
The default implementation performs a guess-and-check algorithm using getDurationField().getUnitMillis() and the add() method. Subclasses are encouraged to provide a more efficient implementation.
getDifferenceAsLong in class ImpreciseDateTimeFieldminuendInstant - 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 set(long instant,
int year)
set in class ImpreciseDateTimeFieldinstant - the time instant in millis to update.year - the year (-9999,9999) to set the date to.java.lang.IllegalArgumentException - if year is invalid.DateTimeField.set(long, int)public DurationField getRangeDurationField()
BaseDateTimeFieldgetRangeDurationField in class ImpreciseDateTimeFieldpublic boolean isLeap(long instant)
BaseDateTimeFieldFor example, a leap year would return true, a non leap year would return false.
This implementation returns false.
isLeap in class BaseDateTimeFieldinstant - the instant to check for leap statuspublic int getLeapAmount(long instant)
BaseDateTimeFieldFor example, a leap year would return one, a non leap year would return zero.
This implementation returns zero.
getLeapAmount in class BaseDateTimeFieldinstant - the instant to check for leap statuspublic DurationField getLeapDurationField()
BaseDateTimeFieldThis implementation returns null.
getLeapDurationField in class BaseDateTimeFieldpublic int getMinimumValue()
BaseDateTimeFieldgetMinimumValue in class BaseDateTimeFieldpublic int getMaximumValue()
BaseDateTimeFieldgetMaximumValue in class BaseDateTimeFieldpublic 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 ImpreciseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to roundpublic long remainder(long instant)
BaseDateTimeFieldFor example, on a datetime of 2002-11-02T23:34:56.789, the remainder by hour is 34 minutes and 56.789 seconds.
The default implementation computes
instant - roundFloor(instant). Subclasses are encouraged to
provide a more efficient implementation.
remainder in class BaseDateTimeFieldinstant - the milliseconds from 1970-01-01T00:00:00Z to get the
remainderprivate java.lang.Object readResolve()