Package org.meteoinfo.jts.index.quadtree
Class NodeBase
- java.lang.Object
-
- org.meteoinfo.jts.index.quadtree.NodeBase
-
- All Implemented Interfaces:
java.io.Serializable
public abstract class NodeBase extends java.lang.Object implements java.io.SerializableThe base class for nodes in aQuadtree.- See Also:
- Serialized Form
-
-
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 resultItems)voidaddAllItemsFromOverlapping(Envelope searchEnv, java.util.List resultItems)java.util.ListgetItems()static intgetSubnodeIndex(Envelope env, double centrex, double centrey)Gets the index of the subquad that wholly contains the given envelope.booleanhasChildren()booleanhasItems()booleanisEmpty()booleanisPrunable()protected abstract booleanisSearchMatch(Envelope searchEnv)booleanremove(Envelope itemEnv, java.lang.Object item)Removes a single item from this subtree.voidvisit(Envelope searchEnv, ItemVisitor visitor)
-
-
-
Field Detail
-
items
protected java.util.List items
-
subnode
protected Node[] subnode
subquads are numbered as follows:2 | 3 --+-- 0 | 1
-
-
Method Detail
-
getSubnodeIndex
public static int getSubnodeIndex(Envelope env, double centrex, double centrey)
Gets the index of the subquad that wholly contains the given envelope. If none does, returns -1.- Returns:
- the index of the subquad that wholly contains the given envelope or -1 if no subquad wholly contains the envelope
-
getItems
public java.util.List getItems()
-
hasItems
public boolean hasItems()
-
add
public void add(java.lang.Object item)
-
remove
public boolean remove(Envelope itemEnv, java.lang.Object item)
Removes a single item from this subtree.- Parameters:
itemEnv- 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()
-
isEmpty
public boolean isEmpty()
-
addAllItems
public java.util.List addAllItems(java.util.List resultItems)
-
isSearchMatch
protected abstract boolean isSearchMatch(Envelope searchEnv)
-
addAllItemsFromOverlapping
public void addAllItemsFromOverlapping(Envelope searchEnv, java.util.List resultItems)
-
visit
public void visit(Envelope searchEnv, ItemVisitor visitor)
-
-