public final class Intervals extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.joda.time.Interval |
ETERNITY |
static com.google.common.collect.ImmutableList<org.joda.time.Interval> |
ONLY_ETERNITY |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canCompareEndpointsAsStrings(org.joda.time.Interval interval)
Returns true if the provided interval has endpoints that can be compared against other DateTimes using their
string representations.
|
static org.joda.time.Interval |
findOverlappingInterval(org.joda.time.Interval searchInterval,
org.joda.time.Interval[] sortedIntervals)
Finds an interval from the given set of sortedIntervals which overlaps with
the searchInterval.
|
static boolean |
isEmpty(org.joda.time.Interval interval) |
static boolean |
isEternity(org.joda.time.Interval interval)
Returns true if the provided interval contains all time.
|
static org.joda.time.Interval |
of(String interval) |
static org.joda.time.Interval |
of(String format,
Object... formatArgs) |
static org.joda.time.Interval |
utc(long startInstant,
long endInstant) |
public static final org.joda.time.Interval ETERNITY
public static final com.google.common.collect.ImmutableList<org.joda.time.Interval> ONLY_ETERNITY
public static org.joda.time.Interval utc(long startInstant,
long endInstant)
public static org.joda.time.Interval of(String interval)
public static boolean isEmpty(org.joda.time.Interval interval)
public static boolean canCompareEndpointsAsStrings(org.joda.time.Interval interval)
DateTimes.canCompareAsString(DateTime).public static boolean isEternity(org.joda.time.Interval interval)
@Nullable public static org.joda.time.Interval findOverlappingInterval(org.joda.time.Interval searchInterval, org.joda.time.Interval[] sortedIntervals)
Comparators.intervalsByStartThenEnd() is returned.searchInterval - Interval which should overlap with the resultsortedIntervals - Candidate overlapping intervals, sorted in ascending
order, using Comparators.intervalsByStartThenEnd().Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.