public class TimeRange extends Object
| 构造器和说明 |
|---|
TimeRange()
Default constructor.
|
TimeRange(long start)
Constructs a timestamp range of [start, Long.MAX_VALUE).
|
TimeRange(long start,
long end)
Constructs a timestamp range of [start, end).
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compare(long timestamp)
Compare a timestamp with a timestamp range
|
boolean |
containsOnlyOneVersion()
Check if the TimeRange only contains one version.
|
boolean |
equals(Object o) |
long |
getEnd() |
long |
getStart() |
int |
hashCode() |
String |
toString() |
boolean |
withinTimeRange(long timestamp)
Checks if the specified timestamp is within this timestamp range.
|
public TimeRange()
public TimeRange(long start)
start - the starting timestamp (inclusive)public TimeRange(long start,
long end)
start - The start timestamp (inclusive)end - The end timestamp (exclusive)public long getStart()
public long getEnd()
public boolean withinTimeRange(long timestamp)
timestamp - the timestamp to checkpublic int compare(long timestamp)
timestamp - the timestamp to comparepublic boolean containsOnlyOneVersion()
Copyright © 2025. All Rights Reserved.