Package org.joda.time.field
Class SkipUndoDateTimeField
- java.lang.Object
-
- org.joda.time.DateTimeField
-
- org.joda.time.field.DelegatedDateTimeField
-
- org.joda.time.field.SkipUndoDateTimeField
-
- All Implemented Interfaces:
java.io.Serializable
public final class SkipUndoDateTimeField extends DelegatedDateTimeField
Wraps another field such that a certain value is added back into the sequence of numbers.This reverses the effect of SkipDateTimeField. This isn't very elegant.
SkipUndoDateTimeField is thread-safe and immutable.
- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Chronology
iChronology
The chronology to wrap.private int
iMinValue
The calculated minimum value.private int
iSkip
The value to skip.private static long
serialVersionUID
Serialization version.
-
Constructor Summary
Constructors Constructor Description SkipUndoDateTimeField(Chronology chronology, DateTimeField field)
Constructor that reinserts zero.SkipUndoDateTimeField(Chronology chronology, DateTimeField field, int skip)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
get(long millis)
Get the value of this field from the milliseconds.int
getMinimumValue()
Get the minimum allowable value for this field.private java.lang.Object
readResolve()
long
set(long millis, int value)
Sets a value in the milliseconds supplied.-
Methods inherited from class org.joda.time.field.DelegatedDateTimeField
add, add, add, addWrapField, addWrapField, addWrapPartial, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getAsText, getDifference, getDifferenceAsLong, getDurationField, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getName, getRangeDurationField, getType, getWrappedField, isLeap, isLenient, isSupported, remainder, roundCeiling, roundFloor, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, set, toString
-
Methods inherited from class org.joda.time.DateTimeField
setExtended
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serialization version.- See Also:
- Constant Field Values
-
iChronology
private final Chronology iChronology
The chronology to wrap.
-
iSkip
private final int iSkip
The value to skip.
-
iMinValue
private transient int iMinValue
The calculated minimum value.
-
-
Constructor Detail
-
SkipUndoDateTimeField
public SkipUndoDateTimeField(Chronology chronology, DateTimeField field)
Constructor that reinserts zero.- Parameters:
chronology
- the chronology to usefield
- the field to skip zero on
-
SkipUndoDateTimeField
public SkipUndoDateTimeField(Chronology chronology, DateTimeField field, int skip)
Constructor.- Parameters:
chronology
- the chronology to usefield
- the field to skip zero onskip
- the value to skip
-
-
Method Detail
-
get
public int get(long millis)
Description copied from class:DateTimeField
Get the value of this field from the milliseconds.- Overrides:
get
in classDelegatedDateTimeField
- Parameters:
millis
- the milliseconds from 1970-01-01T00:00:00Z to query- Returns:
- the value of the field, in the units of the field
-
set
public long set(long millis, int value)
Description copied from class:DateTimeField
Sets a value in the milliseconds supplied.The value of this field will be set. If the value is invalid, an exception if thrown.
If setting this field would make other fields invalid, then those fields may be changed. For example if the current date is the 31st January, and the month is set to February, the day would be invalid. Instead, the day would be changed to the closest value - the 28th/29th February as appropriate.
- Overrides:
set
in classDelegatedDateTimeField
- Parameters:
millis
- the milliseconds from 1970-01-01T00:00:00Z to set invalue
- the value to set, in the units of the field- Returns:
- the updated milliseconds
-
getMinimumValue
public int getMinimumValue()
Description copied from class:DateTimeField
Get the minimum allowable value for this field.- Overrides:
getMinimumValue
in classDelegatedDateTimeField
- Returns:
- the minimum valid value for this field, in the units of the field
-
readResolve
private java.lang.Object readResolve()
-
-