org.joda.time.field
Class LenientDateTimeField
- Serializable
public class LenientDateTimeField
Converts a strict DateTimeField into a lenient one. By being lenient, the
set method accepts out of bounds values, performing an addition instead.
LenientDateTimeField is thread-safe and immutable.
static DateTimeField | getInstance(DateTimeField field, Chronology base) - Returns a lenient version of the given field.
|
boolean | isLenient() - Returns true if the set method is lenient.
|
long | set(long instant, int value) - Set values which may be out of bounds by adding the difference between
the new value and the current value.
|
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 , getWrappedField , isLeap , isLenient , 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 |
getInstance
public static DateTimeField getInstance(DateTimeField field,
Chronology base)
Returns a lenient version of the given field. If it is already lenient,
then it is returned as-is. Otherwise, a new LenientDateTimeField is
returned.
isLenient
public final boolean isLenient()
Returns true if the set method is lenient. If so, it accepts values that
are out of bounds. For example, a lenient day of month field accepts 32
for January, converting it to February 1.
- isLenient in interface DelegatedDateTimeField
- true if this field is lenient
set
public long set(long instant,
int value)
Set values which may be out of bounds by adding the difference between
the new value and the current value.
- set in interface DelegatedDateTimeField
Copyright (c) 2001-2006 - Joda.org