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 TypeMethodDescriptionbooleanabuts(ChronoInterval<PlainDate> other)Queries if this interval abuts the other one such that there is neither any overlap nor any gap between.booleancontains(ChronoInterval<PlainDate> other)Does this interval contain the other one?booleanisBefore(ChronoInterval<PlainDate> other)Is this interval before the other one?booleanisEmpty()A calendar interval is never empty.booleanisFinite()A calendar interval is always finite.booleanisSimultaneous(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, withMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.time4j.range.ChronoInterval
contains, getEnd, getStart, intersects, isAfter, isAfter, isBeforeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
isFinite
public final boolean isFinite()A calendar interval is always finite.
- Specified by:
isFinitein interfaceChronoInterval<T extends FixedCalendarInterval<T>>- Returns:
true
-
isEmpty
public final boolean isEmpty()A calendar interval is never empty.
- Specified by:
isEmptyin interfaceChronoInterval<T extends FixedCalendarInterval<T>>- Returns:
false
-
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 extends FixedCalendarInterval<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)
-
isBefore
Description copied from interface:ChronoIntervalIs this interval before the other one?
- Specified by:
isBeforein interfaceChronoInterval<T extends FixedCalendarInterval<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 extends FixedCalendarInterval<T>>- Parameters:
other- another interval which might abut this interval- Returns:
trueif 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:
trueif this instance is temporally equal tootherelsefalse
-
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
-