|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.DateTimeField org.joda.time.field.BaseDateTimeField org.joda.time.field.PreciseDurationDateTimeField
public abstract class PreciseDurationDateTimeField
Precise datetime field, which has a precise unit duration field.
PreciseDurationDateTimeField is thread-safe and immutable, and its subclasses must be as well.
Constructor Summary | |
---|---|
PreciseDurationDateTimeField(DateTimeFieldType type,
DurationField unit)
Constructor. |
Method Summary | |
---|---|
DurationField |
getDurationField()
Returns the duration per unit value of this field. |
protected int |
getMaximumValueForSet(long instant,
int value)
Called by the set method to get the maximum allowed value. |
int |
getMinimumValue()
Get the minimum value for the field. |
long |
getUnitMillis()
|
boolean |
isLenient()
Returns false by default. |
long |
remainder(long instant)
This method assumes that this field is properly rounded on 1970-01-01T00:00:00. |
long |
roundCeiling(long instant)
This method assumes that this field is properly rounded on 1970-01-01T00:00:00. |
long |
roundFloor(long instant)
This method assumes that this field is properly rounded on 1970-01-01T00:00:00. |
long |
set(long instant,
int value)
Set the specified amount of units to the specified time instant. |
Methods inherited from class org.joda.time.field.BaseDateTimeField |
---|
add, add, add, addWrapField, addWrapField, addWrapPartial, convertText, get, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getAsText, getDifference, getDifferenceAsLong, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getName, getRangeDurationField, getType, isLeap, isSupported, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, set, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PreciseDurationDateTimeField(DateTimeFieldType type, DurationField unit)
type
- the field typeunit
- precise unit duration, like "days()".
IllegalArgumentException
- if duration field is imprecise
IllegalArgumentException
- if unit milliseconds is less than oneMethod Detail |
---|
public boolean isLenient()
isLenient
in class DateTimeField
public long set(long instant, int value)
set
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to set invalue
- value of units to set.
IllegalArgumentException
- if value is too large or too small.public long roundFloor(long instant)
return super.roundFloor(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
roundFloor
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to round
public long roundCeiling(long instant)
return super.roundCeiling(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
roundCeiling
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to round
public long remainder(long instant)
return super.remainder(instant + ALIGNMENT_MILLIS);
remainder
in class BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to get the
remainder
public DurationField getDurationField()
getDurationField
in class BaseDateTimeField
public int getMinimumValue()
getMinimumValue
in class BaseDateTimeField
public final long getUnitMillis()
protected int getMaximumValueForSet(long instant, int value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |