org.joda.time.field
Class 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.
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.
|
add , add , add , addWrapField , addWrapField , addWrapPartial , convertText , get , getAsShortText , getAsShortText , getAsShortText , getAsShortText , getAsShortText , getAsText , getAsText , getAsText , getAsText , getAsText , getDifference , getDifferenceAsLong , getDurationField , getLeapAmount , getLeapDurationField , getMaximumShortTextLength , getMaximumTextLength , getMaximumValue , getMaximumValue , getMaximumValue , getMaximumValue , getMinimumValue , getMinimumValue , getMinimumValue , getMinimumValue , getName , getRangeDurationField , getType , isLeap , isSupported , remainder , roundCeiling , roundFloor , roundHalfCeiling , roundHalfEven , roundHalfFloor , set , set , set , set , set , toString |
add , add , add , addWrapField , addWrapField , addWrapPartial , get , getAsShortText , getAsShortText , getAsShortText , getAsShortText , getAsShortText , getAsText , getAsText , getAsText , getAsText , getAsText , getDifference , getDifferenceAsLong , getDurationField , getLeapAmount , getLeapDurationField , getMaximumShortTextLength , getMaximumTextLength , getMaximumValue , getMaximumValue , getMaximumValue , getMaximumValue , getMinimumValue , getMinimumValue , getMinimumValue , getMinimumValue , getName , getRangeDurationField , getType , isLeap , isLenient , isSupported , remainder , roundCeiling , roundFloor , roundHalfCeiling , roundHalfEven , roundHalfFloor , set , set , set , set , set , toString |
PreciseDurationDateTimeField
public PreciseDurationDateTimeField(DateTimeFieldType type,
DurationField unit)
Constructor.
type
- the field typeunit
- precise unit duration, like "days()".
getDurationField
public DurationField getDurationField()
Returns the duration per unit value of this field. For example, if this
field represents "minute of hour", then the duration field is minutes.
- getDurationField in interface BaseDateTimeField
- the duration of this field, or UnsupportedDurationField if field
has no duration
getMaximumValueForSet
protected int getMaximumValueForSet(long instant,
int value)
Called by the set method to get the maximum allowed value. By default,
returns getMaximumValue(instant). Override to provide a faster
implementation.
getUnitMillis
public final long getUnitMillis()
remainder
public long remainder(long instant)
This method assumes that this field is properly rounded on
1970-01-01T00:00:00. If the rounding alignment differs, override this
method as follows:
return super.remainder(instant + ALIGNMENT_MILLIS);
- remainder in interface BaseDateTimeField
roundCeiling
public long roundCeiling(long instant)
This method assumes that this field is properly rounded on
1970-01-01T00:00:00. If the rounding alignment differs, override this
method as follows:
return super.roundCeiling(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
- roundCeiling in interface BaseDateTimeField
roundFloor
public long roundFloor(long instant)
This method assumes that this field is properly rounded on
1970-01-01T00:00:00. If the rounding alignment differs, override this
method as follows:
return super.roundFloor(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
- roundFloor in interface BaseDateTimeField
set
public long set(long instant,
int value)
Set the specified amount of units to the specified time instant.
- set in interface BaseDateTimeField
instant
- the milliseconds from 1970-01-01T00:00:00Z to set invalue
- value of units to set.
- the updated time instant.
Copyright (c) 2001-2006 - Joda.org