public final class LocalDateTimeInterval extends Object
LocalDateTime. Intervals are
inclusive of the start time and exclusive of the end time. The end time is
always greater than or equal to the start time.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(LocalDateTime t)
Whether this time interval contains the given time.
|
boolean |
contains(LocalDateTimeInterval other) |
LocalDateTime |
end() |
boolean |
equals(Object obj) |
int |
hashCode() |
static LocalDateTimeInterval |
of(LocalDateTime start,
LocalDateTime end)
Creates an interval from a start and end time.
|
static LocalDateTimeInterval |
of(LocalDateTime start,
Period period)
Creates an interval from a start time and a period.
|
static LocalDateTimeInterval |
of(Period period,
LocalDateTime end)
Creates an interval from a period and an end time.
|
boolean |
overlaps(LocalDateTimeInterval other)
Whether this time interval overlaps with the given time interval.
|
LocalDateTime |
start() |
String |
toString() |
public static LocalDateTimeInterval of(LocalDateTime start, LocalDateTime end)
start - the start time of the intervalend - the end time of the intervalpublic static LocalDateTimeInterval of(LocalDateTime start, Period period)
start - the start time of the intervalperiod - the period of the intervalpublic static LocalDateTimeInterval of(Period period, LocalDateTime end)
period - the period of the intervalend - the end time of the intervalpublic LocalDateTime start()
public LocalDateTime end()
public boolean contains(LocalDateTime t)
t - the time to testtrue if this interval contains the given timepublic boolean contains(LocalDateTimeInterval other)
public boolean overlaps(LocalDateTimeInterval other)
other - the interval to testtrue if this interval overlaps with the given intervalCopyright © 2010-2026 NM Group. All Rights Reserved.