//core/io.islandtime.ranges/OffsetDateTimeInterval
OffsetDateTimeInterval¶
common
@Serializable(with = OffsetDateTimeIntervalIsoSerializer::class)
class OffsetDateTimeInterval(start: OffsetDateTime = UNBOUNDED.start, endExclusive: OffsetDateTime = UNBOUNDED.endExclusive) : TimePointInterval<OffsetDateTime>
A half-open interval between two offset date-times based on timeline order.
DateTime.MIN and DateTime.MAX are used as sentinels to indicate an unbounded (i.e. infinite) start or end. An OffsetDateTime with either as the date-time component will be treated accordingly, regardless of the offset.
Constructors¶
OffsetDateTimeInterval | common constructor(start: OffsetDateTime = UNBOUNDED.start, endExclusive: OffsetDateTime = UNBOUNDED.endExclusive) |
Types¶
Name | Summary |
---|---|
Companion | common object Companion |
Properties¶
Name | Summary |
---|---|
endExclusive | common open override val endExclusive: OffsetDateTime The end of this interval, exclusive. |
endInclusive | common open override val endInclusive: OffsetDateTime The end of this interval, inclusive. |
lengthInCenturies | common val OffsetDateTimeInterval.lengthInCenturies: Centuries The number of whole centuries between the start and end of this interval. |
lengthInDays | common val OffsetDateTimeInterval.lengthInDays: Days The number of whole days between the start and end of this interval. |
lengthInDecades | common val OffsetDateTimeInterval.lengthInDecades: Decades The number of whole decades between the start and end of this interval. |
lengthInHours | common val TimePointInterval<*>.lengthInHours: Hours The number of whole hours between the start and end of this interval. |
lengthInMicroseconds | common val TimePointInterval<*>.lengthInMicroseconds: Microseconds The number of whole microseconds between the start and end of this interval. |
lengthInMilliseconds | common val TimePointInterval<*>.lengthInMilliseconds: Milliseconds The number of whole milliseconds between the start and end of this interval. |
lengthInMinutes | common val TimePointInterval<*>.lengthInMinutes: Minutes The number of whole minutes between the start and end of this interval. |
lengthInMonths | common val OffsetDateTimeInterval.lengthInMonths: Months The number of whole months between the start and end of this interval. |
lengthInNanoseconds | common val TimePointInterval<*>.lengthInNanoseconds: Nanoseconds The number of nanoseconds between the start and end of this interval. |
lengthInSeconds | common val TimePointInterval<*>.lengthInSeconds: Seconds The number of whole seconds between the start and end of this interval. |
lengthInWeeks | common val OffsetDateTimeInterval.lengthInWeeks: Weeks The number of whole weeks between the start and end of this interval. |
lengthInYears | common val OffsetDateTimeInterval.lengthInYears: Years The number of whole years between the start and end of this interval. |
start | common open override val start: OffsetDateTime The start of this interval, inclusive. |
Functions¶
Name | Summary |
---|---|
asZonedDateTimeInterval | common fun OffsetDateTimeInterval.asZonedDateTimeInterval(): ZonedDateTimeInterval Converts this interval to an equivalent ZonedDateTimeInterval where both endpoints are given a fixed-offset time zone. |
contains | common open operator override fun contains(value: OffsetDateTime): Boolean Checks if this interval contains value. |
contains | common fun <T> Interval<T>.contains(value: T?): Boolean Checks if this interval contains value. common operator fun <T : TimePoint<T>> TimePointInterval<T>.contains(value: TimePoint<*>?): Boolean Checks if this interval contains value. This will always return false if value is null . |
equals | common open operator override fun equals(other: Any?): Boolean |
hasBoundedEnd | common open fun hasBoundedEnd(): Boolean Checks if this interval's end is bounded, meaning it has a finite value. |
hasBoundedStart | common open fun hasBoundedStart(): Boolean Checks if this interval's start is bounded, meaning it has a finite value. |
hashCode | common open override fun hashCode(): Int |
hasUnboundedEnd | common open override fun hasUnboundedEnd(): Boolean Checks if this interval's end is unbounded. In ISO-8601 terminology, this is an "open" end. |
hasUnboundedStart | common open override fun hasUnboundedStart(): Boolean Checks if this interval's start is unbounded. In ISO-8601 terminology, this is an "open" start. |
isBounded | common open fun isBounded(): Boolean Checks if both the start and end of this interval are bounded, meaning it has a finite range. |
isEmpty | common open override fun isEmpty(): Boolean Checks if this interval is empty. |
isUnbounded | common open fun isUnbounded(): Boolean Checks if both the start and end of this interval are unbounded, meaning this is an infinite time period in both directions. |
random | common fun OffsetDateTimeInterval.random(): OffsetDateTime Returns a random date within this interval using the default random number generator. The offset of the start date-time will be used. common fun OffsetDateTimeInterval.random(random: Random): OffsetDateTime Returns a random date within this interval using the supplied random number generator. The offset of the start date-time will be used. |
randomOrNull | common fun OffsetDateTimeInterval.randomOrNull(): OffsetDateTime? Returns a random date within this interval using the default random number generator or null if the interval is empty or unbounded. The offset of the start date-time will be used.common fun OffsetDateTimeInterval.randomOrNull(random: Random): OffsetDateTime? Returns a random date within this interval using the supplied random number generator or null if the interval is empty or unbounded. The offset of the start date-time will be used. |
toDateRange | common fun OffsetDateTimeInterval.toDateRange(): DateRange Returns this interval with the precision reduced to just the date. |
toDateTimeInterval | common fun OffsetDateTimeInterval.toDateTimeInterval(): DateTimeInterval Returns this interval with the precision reduced to only the local date and time. |
toDuration | common fun TimePointInterval<*>.toDuration(): Duration Converts this interval into a Duration of the same length. |
toInstantInterval | common fun OffsetDateTimeInterval.toInstantInterval(): InstantInterval Converts this interval to an InstantInterval. |
toNSDateInterval | darwin fun <T : TimePoint<T>> TimePointInterval<T>.toNSDateInterval(): <Error class: unknown class> Converts this interval to an equivalent NSDateInterval . |
toNSDateIntervalOrNull | darwin fun <T : TimePoint<T>> TimePointInterval<T>.toNSDateIntervalOrNull(): <Error class: unknown class>? Converts this interval to an equivalent NSDateInterval , or null if the interval is unbounded. |
toPeriod | common fun OffsetDateTimeInterval.toPeriod(): Period Converts this interval into a Period of the same length. |
toString | common open override fun toString(): String Converts this interval to a string in ISO-8601 extended format. |
toZonedDateTimeInterval | common fun OffsetDateTimeInterval.toZonedDateTimeInterval(zone: TimeZone, strategy: OffsetConversionStrategy): ZonedDateTimeInterval Converts this interval to a ZonedDateTimeInterval using the specified strategy to adjust each endpoint to a valid date, time, and offset in zone. |