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 TypeMethodDescriptionboolean
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
Queries if given time point belongs to this interval.boolean
Obtains 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.int
hashCode()
boolean
Is this interval after the given time point?boolean
isBefore(ChronoInterval<T> other)
Is this interval before the other one?boolean
Is this interval before the given time point?boolean
isEmpty()
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:ChronoInterval
Yields the lower bound of this interval.
- Specified by:
getStart
in interfaceChronoInterval<T>
- Returns:
- start interval boundary
-
getEnd
Description copied from interface:ChronoInterval
Yields the upper bound of this interval.
- Specified by:
getEnd
in interfaceChronoInterval<T>
- Returns:
- end interval boundary
-
isEmpty
public boolean isEmpty()Description copied from interface:ChronoInterval
Determines if this interval is empty.
- Specified by:
isEmpty
in interfaceChronoInterval<T>
- Returns:
true
if this interval does not contain any time point elsefalse
-
contains
Description copied from interface:ChronoInterval
Queries if given time point belongs to this interval.
- Specified by:
contains
in interfaceChronoInterval<T>
- Parameters:
temporal
- time point to be queried- Returns:
true
if given time point belongs to this interval elsefalse
-
contains
Description copied from interface:ChronoInterval
Does 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:
contains
in interfaceChronoInterval<T>
- Parameters:
other
- another interval whose relation to this interval is to be investigated- Returns:
true
if this interval contains the other one elsefalse
- See Also:
ChronoInterval.intersects(ChronoInterval)
-
isAfter
Description copied from interface:ChronoInterval
Is this interval after the given time point?
- Specified by:
isAfter
in interfaceChronoInterval<T>
- Parameters:
temporal
- reference time point- Returns:
true
if this interval is after given time point elsefalse
-
isBefore
Description copied from interface:ChronoInterval
Is this interval before the given time point?
- Specified by:
isBefore
in interfaceChronoInterval<T>
- Parameters:
temporal
- reference time point- Returns:
true
if this interval is before given time point elsefalse
-
isBefore
Description copied from interface:ChronoInterval
Is this interval before the other one?
- Specified by:
isBefore
in interfaceChronoInterval<T>
- Parameters:
other
- another interval whose relation to this interval is to be investigated- Returns:
true
if this interval is before the other one elsefalse
-
abuts
Description copied from interface:ChronoInterval
Queries 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:
abuts
in interfaceChronoInterval<T>
- Parameters:
other
- another interval which might abut this interval- Returns:
true
if there is no intersection and no gap between elsefalse
-
equals
-
hashCode
public int hashCode() -
toString
-