Package org.meteoinfo.jts.index.bintree
Class NodeBase
- java.lang.Object
-
- org.meteoinfo.jts.index.bintree.NodeBase
-
-
Constructor Summary
Constructors Constructor Description NodeBase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object item)java.util.ListaddAllItems(java.util.List items)voidaddAllItemsFromOverlapping(Interval interval, java.util.Collection resultItems)Adds items in the tree which potentially overlap the query interval to the given collection.java.util.ListgetItems()static intgetSubnodeIndex(Interval interval, double centre)Returns the index of the subnode that wholely contains the given interval.booleanhasChildren()booleanhasItems()booleanisPrunable()protected abstract booleanisSearchMatch(Interval interval)booleanremove(Interval itemInterval, java.lang.Object item)Removes a single item from this subtree.
-
-
-
Field Detail
-
items
protected java.util.List items
-
subnode
protected Node[] subnode
subnodes are numbered as follows: 0 | 1
-
-
Method Detail
-
getSubnodeIndex
public static int getSubnodeIndex(Interval interval, double centre)
Returns the index of the subnode that wholely contains the given interval. If none does, returns -1.
-
getItems
public java.util.List getItems()
-
add
public void add(java.lang.Object item)
-
addAllItems
public java.util.List addAllItems(java.util.List items)
-
isSearchMatch
protected abstract boolean isSearchMatch(Interval interval)
-
addAllItemsFromOverlapping
public void addAllItemsFromOverlapping(Interval interval, java.util.Collection resultItems)
Adds items in the tree which potentially overlap the query interval to the given collection. If the query interval is null, add all items in the tree.- Parameters:
interval- a query nterval, or nullresultItems- the candidate items found
-
remove
public boolean remove(Interval itemInterval, java.lang.Object item)
Removes a single item from this subtree.- Parameters:
itemInterval- the envelope containing the itemitem- the item to remove- Returns:
trueif the item was found and removed
-
isPrunable
public boolean isPrunable()
-
hasChildren
public boolean hasChildren()
-
hasItems
public boolean hasItems()
-
-