Interface ChronoInterval<T>
- Type Parameters:
T- temporal type of time points within a given interval
- All Known Implementing Classes:
CalendarMonth,CalendarPeriod,CalendarQuarter,CalendarWeek,CalendarYear,ClockInterval,DateInterval,FixedCalendarInterval,IsoInterval,MomentInterval,SimpleInterval,TimestampInterval,ValueInterval
Represents a temporal interval on a timeline.
Note: Time4J-intervals contain every timepoint between start and end boundary without exception (continuous intervals). The start must not be after the end.
- Since:
- 2.0
- Author:
- Meno Hochschild
-
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.getEnd()Yields the upper bound of this interval.getStart()Yields the lower bound of this interval.default booleanintersects(ChronoInterval<T> other)Queries if this interval intersects the other one such that there is at least one common time point.default booleanisAfter(ChronoInterval<T> other)Is this interval after the other one?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.default booleanisFinite()Determines if this interval has finite boundaries.
-
Method Details
-
getStart
Yields the lower bound of this interval.
- Returns:
- start interval boundary
- Since:
- 2.0
-
getEnd
Yields the upper bound of this interval.
- Returns:
- end interval boundary
- Since:
- 2.0
-
isFinite
default boolean isFinite()Determines if this interval has finite boundaries.
- Returns:
trueif start and end are finite elsefalse- Since:
- 2.0
-
isEmpty
boolean isEmpty()Determines if this interval is empty.
- Returns:
trueif this interval does not contain any time point elsefalse- Since:
- 2.0
-
contains
Queries if given time point belongs to this interval.
- Parameters:
temporal- time point to be queried- Returns:
trueif given time point belongs to this interval elsefalse- Since:
- 2.0
-
contains
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.
- Parameters:
other- another interval whose relation to this interval is to be investigated- Returns:
trueif this interval contains the other one elsefalse- Since:
- 3.25/4.21
- See Also:
intersects(ChronoInterval)
-
isAfter
Is this interval after the given time point?
- Parameters:
temporal- reference time point- Returns:
trueif this interval is after given time point elsefalse
-
isAfter
Is this interval after the other one?
- Parameters:
other- another interval whose relation to this interval is to be investigated- Returns:
trueif this interval is after the other one elsefalse- Since:
- 3.25/4.21
-
isBefore
Is this interval before the given time point?
- Parameters:
temporal- reference time point- Returns:
trueif this interval is before given time point elsefalse
-
isBefore
Is this interval before the other one?
- Parameters:
other- another interval whose relation to this interval is to be investigated- Returns:
trueif this interval is before the other one elsefalse- Since:
- 3.25/4.21
-
abuts
Queries if this interval abuts the other one such that there is neither any overlap nor any gap between.
Note: Empty intervals never abut.
- Parameters:
other- another interval which might abut this interval- Returns:
trueif there is no intersection and no gap between elsefalse- Since:
- 3.25/4.21
-
intersects
Queries if this interval intersects the other one such that there is at least one common time point.
In contrast to
contains(ChronoInterval), an interval can never intersect an empty interval.- Parameters:
other- another interval which might have an intersection with this interval- Returns:
trueif there is an non-empty intersection of this interval and the other one elsefalse- Since:
- 3.25/4.21
- See Also:
isBefore(ChronoInterval),isAfter(ChronoInterval)
-