Class FixedCalendarInterval<T extends FixedCalendarInterval<T>>
- All Implemented Interfaces:
Serializable
,Comparable<T>
,Iterable<PlainDate>
,ChronoDisplay
,ChronoInterval<PlainDate>
- Direct Known Subclasses:
CalendarMonth
,CalendarQuarter
,CalendarWeek
,CalendarYear
Represents a fixed calendar interval.
- Since:
- 3.21/4.17
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abuts(ChronoInterval<PlainDate> other)
Queries if this interval abuts the other one such that there is neither any overlap nor any gap between.boolean
contains(ChronoInterval<PlainDate> other)
Does this interval contain the other one?boolean
isBefore(ChronoInterval<PlainDate> other)
Is this interval before the other one?boolean
isEmpty()
A calendar interval is never empty.boolean
isFinite()
A calendar interval is always finite.boolean
isSimultaneous(T other)
Queries if this object and given object have the same position on the time axis.Obtains a stream iterating over every calendar date of this interval.Converts this fixed interval to a date interval with flexible boundaries which can participate in any kind of interval boundary manipulations.<V> ValueInterval<PlainDate,T,V>
withValue(V value)
Creates a combination of this interval with an associated value.Methods inherited from class net.time4j.engine.ChronoEntity
contains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, with
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.time4j.range.ChronoInterval
contains, getEnd, getStart, intersects, isAfter, isAfter, isBefore
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
isFinite
public final boolean isFinite()A calendar interval is always finite.
- Specified by:
isFinite
in interfaceChronoInterval<T extends FixedCalendarInterval<T>>
- Returns:
true
-
isEmpty
public final boolean isEmpty()A calendar interval is never empty.
- Specified by:
isEmpty
in interfaceChronoInterval<T extends FixedCalendarInterval<T>>
- Returns:
false
-
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 extends FixedCalendarInterval<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)
-
isBefore
Description copied from interface:ChronoInterval
Is this interval before the other one?
- Specified by:
isBefore
in interfaceChronoInterval<T extends FixedCalendarInterval<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 extends FixedCalendarInterval<T>>
- Parameters:
other
- another interval which might abut this interval- Returns:
true
if there is no intersection and no gap between elsefalse
-
isSimultaneous
Queries if this object and given object have the same position on the time axis.
- Parameters:
other
- object this instance is compared to- Returns:
true
if this instance is temporally equal toother
elsefalse
-
toFlexInterval
Converts this fixed interval to a date interval with flexible boundaries which can participate in any kind of interval boundary manipulations.
- Returns:
- DateInterval
-
streamDaily
Obtains a stream iterating over every calendar date of this interval.
- Returns:
- daily stream
- Since:
- 4.24
-
withValue
Creates a combination of this interval with an associated value.
- Type Parameters:
V
- generic value type- Parameters:
value
- associated value, notnull
- Returns:
- new value interval
- Since:
- 3.31/4.26
-