protected static class StaticIntervalTree.Node<U extends Comparable<U>,T extends Interval<U>> extends Object
Intervals that are stored within this node either contain the node's point value or are open at an endpoint that equals the node's point value. Intervals are stored so that these two cases are easily distinguished from one another: Each such class of interval is stored in two structures, one is a tree sorted by low endpoint and the other is a tree sorted by high endpoint. This enables efficient point queries as well as insertions and deletions from the node.
| Constructor and Description |
|---|
Node(U point)
Construct a new node associated with the specified point.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the elements of this node.
|
boolean |
delete(T interval)
Delete the specified interval from this node.
|
void |
fetchIntervalsContainingNodePoint(Collection<T> target)
Fetch all intervals from this node that contain the node's point.
|
void |
fetchIntervalsContainingPointHigh(Collection<T> target,
U queryPoint,
boolean isClosedOnValue)
Fetch intervals containing the specified value.
|
void |
fetchIntervalsContainingPointLow(Collection<T> target,
U queryPoint,
boolean isClosedOnValue)
Fetch intervals containing the specified value.
|
void |
fetchOverlappingIntervals(Collection<T> target,
Interval<U> queryInterval)
Fetch all intervals from this node which overlap the specified
interval.
|
StaticIntervalTree.Node<U,T> |
getLeft()
Get the left child.
|
U |
getPoint()
Get the point associated with this node.
|
StaticIntervalTree.Node<U,T> |
getRight()
Get the right child.
|
String |
toString() |
public Node(U point)
point - the point with which this node is associated.public void clear()
public boolean delete(T interval)
interval - the interval to delete.public void fetchIntervalsContainingNodePoint(Collection<T> target)
target - the target Collection into which to place the desired
intervals.public void fetchIntervalsContainingPointHigh(Collection<T> target, U queryPoint, boolean isClosedOnValue)
target - the target Collection into which to place the desired
intervals.queryPoint - the query value.isClosedOnValue - true if the search is inclusive of the specified value,
false otherwise.public void fetchIntervalsContainingPointLow(Collection<T> target, U queryPoint, boolean isClosedOnValue)
target - the target Collection into which to place the desired
intervals.queryPoint - the query value.isClosedOnValue - true if the search is inclusive of the specified value,
false otherwise.public void fetchOverlappingIntervals(Collection<T> target, Interval<U> queryInterval)
Interval.getLow() <= getPoint()
<= Interval.getHigh().target - the target Collection into which to place the desired
intervals.queryInterval - the query interval.public StaticIntervalTree.Node<U,T> getLeft()
public U getPoint()
public StaticIntervalTree.Node<U,T> getRight()
Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.