org.joda.time.field

Class SkipUndoDateTimeField

Implemented Interfaces:
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.

Authors:
Brian S O'Neill
Stephen Colebourne
Since:
1.0

Constructor Summary

SkipUndoDateTimeField(Chronology chronology, DateTimeField field)
Constructor that reinserts zero.
SkipUndoDateTimeField(Chronology chronology, DateTimeField field, int skip)
Constructor.

Method Summary

int
get(long millis)
int
getMinimumValue()
long
set(long millis, int value)

Methods inherited from class org.joda.time.field.DelegatedDateTimeField

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

Methods inherited from class org.joda.time.DateTimeField

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

Constructor Details

SkipUndoDateTimeField

public SkipUndoDateTimeField(Chronology chronology,
                             DateTimeField field)
Constructor that reinserts zero.
Parameters:
chronology - the chronoogy to use
field - the field to skip zero on

SkipUndoDateTimeField

public SkipUndoDateTimeField(Chronology chronology,
                             DateTimeField field,
                             int skip)
Constructor.
Parameters:
chronology - the chronoogy to use
field - the field to skip zero on
skip - the value to skip

Method Details

get

public int get(long millis)
Overrides:
get in interface DelegatedDateTimeField

getMinimumValue

public int getMinimumValue()
Overrides:
getMinimumValue in interface DelegatedDateTimeField

set

public long set(long millis,
                int value)
Overrides:
set in interface DelegatedDateTimeField

Copyright (c) 2001-2006 - Joda.org