T - temporal type of time points within a given intervalI - generic interval typeV - value type associated with a value intervalpublic class ValueInterval<T,I extends ChronoInterval<T>,V> extends Object implements ChronoInterval<T>, Serializable
Represents a temporal interval with an associated value.
Value intervals are either based on subclasses of IsoInterval or FixedCalendarInterval
and can be created by the interval instance methods named withValue(V). The serializability
is determined by the serializability of the value type.
IsoInterval.withValue(V),
FixedCalendarInterval.withValue(V),
Serialized Form| Modifier and Type | Method and Description |
|---|---|
boolean |
abuts(ChronoInterval<T> other)
Queries if this interval abuts the other one such that there is neither any overlap nor any gap between.
|
boolean |
contains(ChronoInterval<T> other)
Does this interval contain the other one?
|
boolean |
contains(T temporal)
Queries if given time point belongs to this interval.
|
boolean |
equals(Object obj) |
I |
getBoundaries()
Obtains the interval delegate instance.
|
Boundary<T> |
getEnd()
Yields the upper bound of this interval.
|
Boundary<T> |
getStart()
Yields the lower bound of this interval.
|
V |
getValue()
Obtains the associated value.
|
int |
hashCode() |
boolean |
isAfter(T temporal)
Is this interval after the given time point?
|
boolean |
isBefore(ChronoInterval<T> other)
Is this interval before the other one?
|
boolean |
isBefore(T temporal)
Is this interval before the given time point?
|
boolean |
isEmpty()
Determines if this interval is empty.
|
String |
toString() |
ValueInterval<T,I,V> |
withValue(V value)
Assigns this value interval with given new value.
|
intersects, isAfter, isFinitepublic V getValue()
Obtains the associated value.
public ValueInterval<T,I,V> withValue(V value)
Assigns this value interval with given new value.
value - associated value, not nullpublic I getBoundaries()
Obtains the interval delegate instance.
public Boundary<T> getStart()
ChronoIntervalYields the lower bound of this interval.
getStart in interface ChronoInterval<T>public Boundary<T> getEnd()
ChronoIntervalYields the upper bound of this interval.
getEnd in interface ChronoInterval<T>public boolean isEmpty()
ChronoIntervalDetermines if this interval is empty.
isEmpty in interface ChronoInterval<T>true if this interval does not contain any time point else falsepublic boolean contains(T temporal)
ChronoIntervalQueries if given time point belongs to this interval.
contains in interface ChronoInterval<T>temporal - time point to be queriedtrue if given time point belongs to this interval else falsepublic boolean contains(ChronoInterval<T> other)
ChronoIntervalDoes this interval contain the other one?
An interval cannot contain infinite intervals but can contain an empty interval if it contains the start anchor of the empty interval.
contains in interface ChronoInterval<T>other - another interval whose relation to this interval is to be investigatedtrue if this interval contains the other one else falseChronoInterval.intersects(ChronoInterval)public boolean isAfter(T temporal)
ChronoIntervalIs this interval after the given time point?
isAfter in interface ChronoInterval<T>temporal - reference time pointtrue if this interval is after given time point else falsepublic boolean isBefore(T temporal)
ChronoIntervalIs this interval before the given time point?
isBefore in interface ChronoInterval<T>temporal - reference time pointtrue if this interval is before given time point else falsepublic boolean isBefore(ChronoInterval<T> other)
ChronoIntervalIs this interval before the other one?
isBefore in interface ChronoInterval<T>other - another interval whose relation to this interval is to be investigatedtrue if this interval is before the other one else falsepublic boolean abuts(ChronoInterval<T> other)
ChronoIntervalQueries if this interval abuts the other one such that there is neither any overlap nor any gap between.
Note: Empty intervals never abut.
abuts in interface ChronoInterval<T>other - another interval which might abut this intervaltrue if there is no intersection and no gap between else falseCopyright © 2014–2021. All rights reserved.