public class Interval
extends java.lang.Object
[startTimestamp, endTimestamp)
.Constructor and Description |
---|
Interval()
Constructor for empty interval.
|
Interval(Interval other) |
Interval(long startTimestamp)
Constructor for interval with open end.
|
Interval(long startTimestamp,
long endTimestamp)
Constructor for interval with closed end.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsInterval(Interval other)
Checks whether this interval contains the specified interval.
|
boolean |
containsTimestamp(long timestamp)
Checks whether this interval contains the specified timestamp.
|
boolean |
equals(java.lang.Object obj) |
long |
getEndTimestamp() |
long |
getLength()
Get's the length of the interval.
|
long |
getStartTimestamp() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isOpenEnded() |
void |
setEmpty(boolean empty) |
void |
setEndTimestamp(long timestamp) |
void |
setOpenEnded(boolean openEnded) |
void |
setStartTimestamp(long timestamp) |
java.lang.String |
toString() |
public Interval()
public Interval(long startTimestamp)
startTimestamp
- public Interval(long startTimestamp, long endTimestamp)
startTimestamp
- endTimestamp
- public Interval(Interval other)
public long getStartTimestamp()
public void setStartTimestamp(long timestamp)
public long getEndTimestamp()
public void setEndTimestamp(long timestamp)
public boolean isEmpty()
public void setEmpty(boolean empty)
public boolean isOpenEnded()
public void setOpenEnded(boolean openEnded)
public long getLength()
public boolean containsTimestamp(long timestamp)
timestamp
- The timestamppublic boolean containsInterval(Interval other)
other
- The other intervalpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object