Interface OffsetValue<V>
- Type Parameters:
V- the value type
- All Known Implementing Classes:
OffsetValue.DefaultOffsetValue, OffsetValue.DurationOffsetValue, OffsetValue.InstantOffsetValue, OffsetValue.TemporalOffsetValue
Encapsulates a value that is offset from some basis, and updated via
Value.set(Object).- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe default offset value implementation.static classA duration-based offset value implementation.static classAn instant-based offset value implementation.static classA temporal offset value implementation.Nested classes/interfaces inherited from interface Value
Value.AbstractValue<V> -
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetValue<Duration> Creates a duration-based offset value from the specified basis.static OffsetValue<Instant> Creates a instant-based offset value from the specified basis.default Vget()Returns the current value, computed by applying the current offset to the basis.getBasis()Returns the basis from which the associated offset will be applied.The current offset.rebase()Returns a new offset value based on the current value.default voidSets the current offset.
-
Method Details
-
getBasis
V getBasis()Returns the basis from which the associated offset will be applied.- Returns:
- the basis from which the associated offset will be applied.
-
get
-
getOffset
-
setOffset
-
rebase
OffsetValue<V> rebase()Returns a new offset value based on the current value.- Returns:
- a new offset value
-
from
Creates a duration-based offset value from the specified basis.- Parameters:
duration- the offset basis- Returns:
- a duration-based offset value from the specified basis.
-
from
Creates a instant-based offset value from the specified basis.- Parameters:
instant- the offset basis- Returns:
- a instant-based offset value from the specified basis.
-