|
|||||||||||
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.DelegatedDateTimeField org.joda.time.field.SkipDateTimeField
Wraps another field such that a certain value is skipped.
This is most useful for years where you want to skip zero, so the sequence runs ...,2,1,-1,-2,...
SkipDateTimeField is thread-safe and immutable.
Constructor Summary | |
SkipDateTimeField(Chronology chronology,
DateTimeField field)
Constructor that skips zero. |
|
SkipDateTimeField(Chronology chronology,
DateTimeField field,
int skip)
Constructor. |
Method Summary | |
int |
get(long millis)
Get the value of this field from the milliseconds. |
int |
getMinimumValue()
Get the minimum allowable value for this field. |
long |
set(long millis,
int value)
Sets a value in the milliseconds supplied. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SkipDateTimeField(Chronology chronology, DateTimeField field)
chronology
- the chronoogy to usefield
- the field to skip zero onpublic SkipDateTimeField(Chronology chronology, DateTimeField field, int skip)
chronology
- the chronoogy to usefield
- the field to skip zero onskip
- the value to skipMethod Detail |
public int get(long millis)
DateTimeField
get
in class DelegatedDateTimeField
public long set(long millis, int value)
DateTimeField
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.
set
in class DelegatedDateTimeField
public int getMinimumValue()
DateTimeField
getMinimumValue
in class DelegatedDateTimeField
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |