public final class Interval extends Object
Modifier and Type | Field and Description |
---|---|
static Interval |
INFINITY_INTERVAL
Infinity interval on both bounds.
|
Constructor and Description |
---|
Interval(double low,
double high)
Constructor with bounds and whether they are included or excluded.
|
Interval(Interval interval)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Double timestamp)
Compares this interval to the given timetamp.
|
int |
compareTo(Interval interval)
Compares this interval with the specified interval for order.
|
boolean |
equals(Object obj)
Compares this interval with the specified object for equality.
|
double |
getHigh()
Returns the right endpoint.
|
double |
getLow()
Returns the left endpoint.
|
int |
hashCode() |
String |
toString() |
public static final Interval INFINITY_INTERVAL
public Interval(Interval interval)
interval
- interval to copypublic Interval(double low, double high)
low
- interval's low boundhigh
- interval's high boundpublic int compareTo(Interval interval)
Any two intervals i and i' satisfy the interval trichotomy; that is, exactly one of the following three properties holds:
Note that if two intervals are equal (i.low = i'.low
and
i.high = i'.high
), they overlap as well. But if they simply
overlap (for instance i.low < i'.low
and i.high >
i'.high
) they aren't equal.
interval
- the interval to be comparedNullPointerException
- if interval
is null.public int compareTo(Double timestamp)
timestamp
- timestampNullPointerException
- if timestamp
is null.public double getLow()
public double getHigh()
public boolean equals(Object obj)
Note that two intervals are equal if i.low = i'.low
and
i.high = i'.high
.
Copyright © 2007–2017 Gephi Consortium. All rights reserved.