public abstract class NodeBase
extends java.lang.Object
implements java.io.Serializable
Quadtree
.Modifier and Type | Field and Description |
---|---|
protected java.util.List |
items |
protected Node[] |
subnode
subquads are numbered as follows:
|
Constructor and Description |
---|
NodeBase() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object item) |
java.util.List |
addAllItems(java.util.List resultItems) |
void |
addAllItemsFromOverlapping(Envelope searchEnv,
java.util.List resultItems) |
(package private) int |
depth() |
java.util.List |
getItems() |
(package private) int |
getNodeCount() |
static int |
getSubnodeIndex(Envelope env,
double centrex,
double centrey)
Gets the index of the subquad that wholly contains the given envelope.
|
boolean |
hasChildren() |
boolean |
hasItems() |
boolean |
isEmpty() |
boolean |
isPrunable() |
protected abstract boolean |
isSearchMatch(Envelope searchEnv) |
boolean |
remove(Envelope itemEnv,
java.lang.Object item)
Removes a single item from this subtree.
|
(package private) int |
size() |
void |
visit(Envelope searchEnv,
ItemVisitor visitor) |
private void |
visitItems(Envelope searchEnv,
ItemVisitor visitor) |
protected java.util.List items
protected Node[] subnode
2 | 3 --+-- 0 | 1
public static int getSubnodeIndex(Envelope env, double centrex, double centrey)
public java.util.List getItems()
public boolean hasItems()
public void add(java.lang.Object item)
public boolean remove(Envelope itemEnv, java.lang.Object item)
itemEnv
- the envelope containing the itemitem
- the item to removetrue
if the item was found and removedpublic boolean isPrunable()
public boolean hasChildren()
public boolean isEmpty()
public java.util.List addAllItems(java.util.List resultItems)
protected abstract boolean isSearchMatch(Envelope searchEnv)
public void addAllItemsFromOverlapping(Envelope searchEnv, java.util.List resultItems)
public void visit(Envelope searchEnv, ItemVisitor visitor)
private void visitItems(Envelope searchEnv, ItemVisitor visitor)
int depth()
int size()
int getNodeCount()