V - generic type of element valuesT - generic type of target entity an operator is applied topublic interface AdjustableElement<V,T> extends ZonalElement<V>
Extends a chronological element by some standard ways of manipulation.
| Modifier and Type | Method and Description |
|---|---|
ElementOperator<T> |
atCeiling()
Rounds up an entity by setting all child elements to maximum.
|
default ChronoOperator<T> |
atCeiling(V value)
Combines
newValue(V) and then atCeiling(). |
ElementOperator<T> |
atFloor()
Rounds down an entity by setting all child elements to minimum.
|
default ChronoOperator<T> |
atFloor(V value)
Combines
newValue(V) and then atFloor(). |
ElementOperator<T> |
decremented()
Adjusts any local entity such that this element gets the previous
value.
|
ElementOperator<T> |
incremented()
Adjusts any local entity such that this element gets the next
value.
|
ElementOperator<T> |
maximized()
Sets any local entity to the maximum of this element.
|
ElementOperator<T> |
minimized()
Sets any local entity to the minimum of this element.
|
ElementOperator<T> |
newValue(V value)
Sets any local entity to given new value of this element.
|
at, atUTC, in, inStdTimezone, inTimezonecompare, getDefaultMaximum, getDefaultMinimum, getDisplayName, getSymbol, getType, isDateElement, isLenient, isTimeElement, namecomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongElementOperator<T> newValue(V value)
Sets any local entity to given new value of this element.
value - new element valuePlainTimestampChronoEntity.with(ChronoElement, V)ElementOperator<T> minimized()
Sets any local entity to the minimum of this element.
PlainTimestampElementOperator<T> maximized()
Sets any local entity to the maximum of this element.
PlainTimestampElementOperator<T> decremented()
Adjusts any local entity such that this element gets the previous value.
The operator throws a ChronoException if there is no
base unit available for this element.
PlainTimestamp
and requiring a base unit in given chronology for decrementingTimeAxis.getBaseUnit(ChronoElement)ElementOperator<T> incremented()
Adjusts any local entity such that this element gets the next value.
The operator throws a ChronoException if there is no
base unit available for this element.
PlainTimestamp
and requiring a base unit in given chronology for incrementingTimeAxis.getBaseUnit(ChronoElement)ElementOperator<T> atFloor()
Rounds down an entity by setting all child elements to minimum.
Many elements are organized by parent-child-relations. The most important dependency chain is: YEAR -> MONTH -> DAY_OF_MONTH -> HOUR_OF_DAY -> MINUTE -> SECOND -> NANO_OF_SECOND. If there is no child element then this operator will not do anything (no-op). Example:
PlainDate date = PlainDate.of(2016, 11, 24);
// DAY_OF_WEEK has no time element as child in context of plain calendar dates
System.out.println(date.with(DAY_OF_WEEK.atFloor())); // 2016-11-24
PlainTimestamp tsp = date.atTime(20, 45);
// DAY_OF_WEEK has now child elements which can be set to zero
System.out.println(tsp.with(DAY_OF_WEEK.atFloor())); // 2016-11-24T00
ElementOperator<T> atCeiling()
Rounds up an entity by setting all child elements to maximum.
Many elements are organized by parent-child-relations. The most important dependency chain is: YEAR -> MONTH -> DAY_OF_MONTH -> HOUR_OF_DAY -> MINUTE -> SECOND -> NANO_OF_SECOND. If there is no child element then this operator will not do anything (no-op). Example:
PlainDate date = PlainDate.of(2016, 11, 24);
// DAY_OF_WEEK has no time element as child in context of plain calendar dates
System.out.println(date.with(DAY_OF_WEEK.atCeiling())); // 2016-11-24
PlainTimestamp tsp = date.atTime(20, 45);
// DAY_OF_WEEK has now child elements which can be all maximized
System.out.println(tsp.with(DAY_OF_WEEK.atCeiling())); // 2016-11-24T23:59:59,999999999
default ChronoOperator<T> atFloor(V value)
Combines newValue(V) and then atFloor().
Example:
PlainTime time = PlainTime.nowInSystemTime();
assertThat(
time.with(PlainTime.DIGITAL_HOUR_OF_DAY.atFloor(7)),
is(PlainTime.of(7, 0)));
value - new element valueChronoEntity.with(ChronoElement, V),
newValue(V),
atFloor()default ChronoOperator<T> atCeiling(V value)
Combines newValue(V) and then atCeiling().
value - new element valueChronoEntity.with(ChronoElement, V),
newValue(V),
atCeiling()Copyright © 2014–2017. All rights reserved.