net.time4j.range

Interface ChronoInterval<T>

• Method Summary

All Methods
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.
Boundary<T> getEnd()
Yields the upper bound of this interval.
Boundary<T> getStart()
Yields the lower bound of this interval.
default boolean intersects(ChronoInterval<T> other)
Queries if this interval intersects the other one such that there is at least one common time point.
default boolean isAfter(ChronoInterval<T> other)
Is this interval after the other one?
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.
default boolean isFinite()
Determines if this interval has finite boundaries.
• Method Detail

• getStart

Boundary<T> getStart()

Yields the lower bound of this interval.

Returns:
start interval boundary
Since:
2.0
• getEnd

Boundary<T> 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:
true if start and end are finite else false
Since:
2.0
• isEmpty

boolean isEmpty()

Determines if this interval is empty.

Returns:
true if this interval does not contain any time point else false
Since:
2.0
• contains

boolean contains(T temporal)

Queries if given time point belongs to this interval.

Parameters:
temporal - time point to be queried
Returns:
true if given time point belongs to this interval else false
Since:
2.0
• contains

boolean contains(ChronoInterval<T> other)

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:
true if this interval contains the other one else false
Since:
3.25/4.21
intersects(ChronoInterval)
• isAfter

boolean isAfter(T temporal)

Is this interval after the given time point?

Parameters:
temporal - reference time point
Returns:
true if this interval is after given time point else false
• isAfter

default boolean isAfter(ChronoInterval<T> other)

Is this interval after the other one?

Parameters:
other - another interval whose relation to this interval is to be investigated
Returns:
true if this interval is after the other one else false
Since:
3.25/4.21
• isBefore

boolean isBefore(T temporal)

Is this interval before the given time point?

Parameters:
temporal - reference time point
Returns:
true if this interval is before given time point else false
• isBefore

boolean isBefore(ChronoInterval<T> other)

Is this interval before the other one?

Parameters:
other - another interval whose relation to this interval is to be investigated
Returns:
true if this interval is before the other one else false
Since:
3.25/4.21
• abuts

boolean abuts(ChronoInterval<T> other)

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:
true if there is no intersection and no gap between else false
Since:
3.25/4.21
• intersects

default boolean intersects(ChronoInterval<T> other)

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:
true if there is an non-empty intersection of this interval and the other one else false
Since:
3.25/4.21