Class ValueInterval<T,I extends ChronoInterval<T>,V>
- Type Parameters:
T- temporal type of time points within a given intervalI- generic interval typeV- value type associated with a value interval
- All Implemented Interfaces:
Serializable,ChronoInterval<T>
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.
- Since:
- 3.31/4.26
- Author:
- Meno Hochschild
- See Also:
IsoInterval.withValue(V),FixedCalendarInterval.withValue(V), Serialized Form
-
Method Summary
Modifier and TypeMethodDescriptionbooleanabuts(ChronoInterval<T> other)Queries if this interval abuts the other one such that there is neither any overlap nor any gap between.booleancontains(ChronoInterval<T> other)Does this interval contain the other one?booleanQueries if given time point belongs to this interval.booleanObtains the interval delegate instance.getEnd()Yields the upper bound of this interval.getStart()Yields the lower bound of this interval.getValue()Obtains the associated value.inthashCode()booleanIs this interval after the given time point?booleanisBefore(ChronoInterval<T> other)Is this interval before the other one?booleanIs this interval before the given time point?booleanisEmpty()Determines if this interval is empty.toString()ValueInterval<T,I,V>Assigns this value interval with given new value.Methods inherited from interface net.time4j.range.ChronoInterval
intersects, isAfter, isFinite
-
Method Details
-
getValue
Obtains the associated value.
- Returns:
- value associated with this interval
-
withValue
Assigns this value interval with given new value.
- Parameters:
value- associated value, notnull- Returns:
- new value interval
-
getBoundaries
Obtains the interval delegate instance.
- Returns:
- wrapped interval delegate
-
getStart
Description copied from interface:ChronoIntervalYields the lower bound of this interval.
- Specified by:
getStartin interfaceChronoInterval<T>- Returns:
- start interval boundary
-
getEnd
Description copied from interface:ChronoIntervalYields the upper bound of this interval.
- Specified by:
getEndin interfaceChronoInterval<T>- Returns:
- end interval boundary
-
isEmpty
public boolean isEmpty()Description copied from interface:ChronoIntervalDetermines if this interval is empty.
- Specified by:
isEmptyin interfaceChronoInterval<T>- Returns:
trueif this interval does not contain any time point elsefalse
-
contains
Description copied from interface:ChronoIntervalQueries if given time point belongs to this interval.
- Specified by:
containsin interfaceChronoInterval<T>- Parameters:
temporal- time point to be queried- Returns:
trueif given time point belongs to this interval elsefalse
-
contains
Description copied from interface: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.
- Specified by:
containsin interfaceChronoInterval<T>- Parameters:
other- another interval whose relation to this interval is to be investigated- Returns:
trueif this interval contains the other one elsefalse- See Also:
ChronoInterval.intersects(ChronoInterval)
-
isAfter
Description copied from interface:ChronoIntervalIs this interval after the given time point?
- Specified by:
isAfterin interfaceChronoInterval<T>- Parameters:
temporal- reference time point- Returns:
trueif this interval is after given time point elsefalse
-
isBefore
Description copied from interface:ChronoIntervalIs this interval before the given time point?
- Specified by:
isBeforein interfaceChronoInterval<T>- Parameters:
temporal- reference time point- Returns:
trueif this interval is before given time point elsefalse
-
isBefore
Description copied from interface:ChronoIntervalIs this interval before the other one?
- Specified by:
isBeforein interfaceChronoInterval<T>- Parameters:
other- another interval whose relation to this interval is to be investigated- Returns:
trueif this interval is before the other one elsefalse
-
abuts
Description copied from interface:ChronoIntervalQueries if this interval abuts the other one such that there is neither any overlap nor any gap between.
Note: Empty intervals never abut.
- Specified by:
abutsin interfaceChronoInterval<T>- Parameters:
other- another interval which might abut this interval- Returns:
trueif there is no intersection and no gap between elsefalse
-
equals
-
hashCode
public int hashCode() -
toString
-