Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private Comparator |
Access | Constructor and Description |
---|---|
public | IntervalTree(Comparator<Object> endpointComparator)
This constructor takes only one comparator: one which operates upon the endpoints of the Intervals this tree will store. |
Modifier and Type | Method and Description |
---|---|
public List | findAllNodesIntersecting(Interval interval)
Returns a List<IntervalNode> indicating which nodes' intervals were intersected by the given query interval. |
protected Object | |
public void | |
public void | |
private void | printFromNode(RBNode node, PrintStream tty, int indentDepth)
Debugging
|
public void | |
private void | |
protected void | |
private void |
endpointComparator | back to summary |
---|---|
private Comparator<Object> endpointComparator |
IntervalTree | back to summary |
---|---|
public IntervalTree(Comparator<Object> endpointComparator) This constructor takes only one comparator: one which operates upon the endpoints of the Intervals this tree will store. It constructs an internal "interval comparator" out of this one. |
findAllNodesIntersecting | back to summary |
---|---|
public List Returns a List<IntervalNode> indicating which nodes' intervals were intersected by the given query interval. It is guaranteed that these nodes will be returned sorted by increasing low endpoint. |
getNodeValue | back to summary |
---|---|
protected Object getNodeValue(RBNode node) |
insert | back to summary |
---|---|
public void insert(Interval interval, Object data) |
back to summary | |
---|---|
public void print() Overrides sun. |
printFromNode | back to summary |
---|---|
private void printFromNode(RBNode node, PrintStream tty, int indentDepth) Hides sun. Debugging |
printOn | back to summary |
---|---|
public void printOn(PrintStream tty) Overrides sun. |
searchForIntersectingNodesFrom | back to summary |
---|---|
private void searchForIntersectingNodesFrom(IntervalNode node, Interval interval, List<IntervalNode> resultList) |
verify | back to summary |
---|---|
protected void verify() Overrides sun. Doc from sun. Verify invariants are preserved |
verifyFromNode | back to summary |
---|---|
private void verifyFromNode(RBNode node) |
Modifier and Type | Field and Description |
---|---|
private Comparator |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public int | compare(Object
the first object to be compared. o1, Object the second object to be compared. o2)Implements java. |
endpointComparator | back to summary |
---|---|
private Comparator<Object> endpointComparator |
IntervalComparator | back to summary |
---|---|
public IntervalComparator(Comparator<Object> endpointComparator) |
compare | back to summary |
---|---|
public int compare(Object o1, Object o2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that |