V - generic enum type of element valuespublic interface NavigableElement<V extends Enum<V>> extends AdjustableElement<V,PlainDate>
Defines additional enum-based operators for setting new element values taking into account the old element value.
| Modifier and Type | Method and Description |
|---|---|
ElementOperator<PlainDate> |
setToNext(V value)
Moves a time point to the first given element value which is after
the current element value.
|
ElementOperator<PlainDate> |
setToNextOrSame(V value)
Moves a time point to the first given element value which is after
or equal to the current element value.
|
ElementOperator<PlainDate> |
setToPrevious(V value)
Moves a time point to the first given element value which is before
the current element value.
|
ElementOperator<PlainDate> |
setToPreviousOrSame(V value)
Moves a time point to the first given element value which is before
or equal to the current element value.
|
atCeiling, atFloor, decremented, incremented, maximized, minimized, newValueat, atUTC, in, inStdTimezone, inTimezonecompare, getDefaultMaximum, getDefaultMinimum, getSymbol, getType, isDateElement, isLenient, isTimeElement, namecomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongElementOperator<PlainDate> setToNext(V value)
Moves a time point to the first given element value which is after the current element value.
Example for a date which shall be moved to a special weekday:
import static net.time4j.Month.MARCH; import static net.time4j.PlainDate.DAY_OF_WEEK; import static net.time4j.Weekday.MONDAY; PlainDate date = PlainDate.of(2013, MARCH, 7); // Thursday System.out.println(date.with(DAY_OF_WEEK.setToNext(MONDAY))); // output: 2013-03-11 (first monday after march 7th)
value - new element value which is after current valuePlainTimestampElementOperator<PlainDate> setToPrevious(V value)
Moves a time point to the first given element value which is before the current element value.
Example for a date which shall be moved to a special weekday:
import static net.time4j.IsoElement.DAY_OF_WEEK; import static net.time4j.Month.MARCH; import static net.time4j.Weekday.THURSDAY; PlainDate date = PlainDate.of(2013, MARCH, 7); // Thursday System.out.println(date.with(DAY_OF_WEEK.setToPrevious(THURSDAY))); // output: 2013-02-28 (Thursday one week earlier)
value - new element value which is before current valuePlainTimestampElementOperator<PlainDate> setToNextOrSame(V value)
Moves a time point to the first given element value which is after or equal to the current element value.
Is the current element value equal to the given element value then there is no movement.
value - new element value which is either after current value
or the samePlainTimestampElementOperator<PlainDate> setToPreviousOrSame(V value)
Moves a time point to the first given element value which is before or equal to the current element value.
Is the current element value equal to the given element value then there is no movement.
value - new element value which is either before current value
or the samePlainTimestampCopyright © 2014–2015. All rights reserved.