V - data type to be used for ends of the intervalpublic class Interval1D<V extends Comparable<V>> extends Object implements Comparable<Interval1D<V>>
IntervalST.IntervalST| Constructor and Description |
|---|
Interval1D(V left,
V right)
Precondition:
left <= right |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Interval1D<V> other) |
boolean |
contains(V x)
Does this interval contain a point?
|
boolean |
equals(Object obj) |
V |
getHi() |
V |
getLo() |
int |
hashCode() |
boolean |
intersects(Interval1D<V> other)
Does this interval intersect that one?
|
static void |
main(String[] args) |
String |
toString() |
public final V extends Comparable<V> lo
public final V extends Comparable<V> hi
public boolean intersects(Interval1D<V> other)
other - public boolean contains(V x)
x - public int compareTo(Interval1D<V> other)
compareTo in interface Comparable<Interval1D<V extends Comparable<V>>>public V getLo()
public V getHi()
public static void main(String[] args)
Copyright © 2017. All rights reserved.