public class TimeInterval extends Object
| Constructor and Description |
|---|
TimeInterval(long fromMs,
long toMs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(long timestampMs)
Checks whether the interval contains the given time stamp.
|
boolean |
endsAfter(long timestampMs)
Checks whether the interval end after the given time stamp.
|
boolean |
equals(Object o) |
long |
getDurationMs()
Returns the duration in ms.
|
int |
hashCode() |
TimeInterval |
notEarlierThan(long timestampMs)
Shortens the interval to the specified start value, if is contained in
the interval.
|
TimeInterval |
notLaterThan(long timestampMs)
Shortens the interval to the specified end value, if is contained in the
interval.
|
TimeInterval |
startAndDuration(long durationMs)
Returns a new interval starting at the previous time, but ending after
the specified duration.
|
String |
toString() |
public TimeInterval notLaterThan(long timestampMs)
public TimeInterval notEarlierThan(long timestampMs)
public TimeInterval startAndDuration(long durationMs)
public long getDurationMs()
public boolean contains(long timestampMs)
public boolean endsAfter(long timestampMs)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.