Serializable
public final class Interval extends Object implements Serializable
Modifier and Type | Method | Description |
---|---|---|
boolean |
contains(long instant) |
Test if this interval contains the given instant.
|
boolean |
contains(Interval interval) |
Test if this interval contains the given interval.
|
boolean |
isAfter(long instant) |
|
boolean |
isAfter(Interval interval) |
|
boolean |
isBefore(long instant) |
|
boolean |
isBefore(Interval interval) |
|
static Interval |
of(long start,
long end) |
Retrieve an interval in between start and end expressed as millis from epoch.
|
static Interval |
of(Instant start,
Instant end) |
Retrieve an interval in between start and end instants.
|
Interval |
overlap(Interval interval) |
|
boolean |
overlaps(Interval interval) |
|
long |
toDurationMillis() |
|
String |
toString() |
public static Interval of(Instant start, Instant end)
start
- Start instantend
- End instantpublic static Interval of(long start, long end)
start
- Start time (epoch millis)end
- End time (epoch millis)public boolean contains(long instant)
instant
- Instant (epoch millis)public boolean contains(Interval interval)
interval
- Interval to testpublic boolean isAfter(long instant)
public boolean isAfter(Interval interval)
public boolean isBefore(long instant)
public boolean isBefore(Interval interval)
public boolean overlaps(Interval interval)
public long toDurationMillis()
Copyright © 2019. All rights reserved.