public abstract class Node extends Object implements Comparable<Node>
Modifier and Type | Field and Description |
---|---|
static byte |
LEAF_BYTE |
protected com.spatial4j.core.shape.SpatialRelation |
shapeRel |
Modifier | Constructor and Description |
---|---|
protected |
Node(SpatialPrefixTree spatialPrefixTree,
byte[] bytes,
int off,
int len) |
protected |
Node(SpatialPrefixTree spatialPrefixTree,
String token) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Node o) |
boolean |
equals(Object obj) |
com.spatial4j.core.shape.Point |
getCenter() |
int |
getLevel() |
abstract com.spatial4j.core.shape.Shape |
getShape() |
com.spatial4j.core.shape.SpatialRelation |
getShapeRel() |
abstract Node |
getSubCell(com.spatial4j.core.shape.Point p)
Performant implementations are expected to implement this efficiently by considering the current
cell's boundary.
|
protected abstract Collection<Node> |
getSubCells()
Gets the cells at the next grid cell level that cover this cell.
|
Collection<Node> |
getSubCells(com.spatial4j.core.shape.Shape shapeFilter)
Like
getSubCells() but with the results filtered by a shape. |
abstract int |
getSubCellsSize()
getSubCells() .size() -- usually a constant. |
byte[] |
getTokenBytes()
Note: doesn't contain a trailing leaf byte.
|
String |
getTokenString()
Note: doesn't contain a trailing leaf byte.
|
int |
hashCode() |
boolean |
isLeaf() |
void |
reset(byte[] bytes,
int off,
int len) |
void |
setLeaf() |
String |
toString() |
public static final byte LEAF_BYTE
protected com.spatial4j.core.shape.SpatialRelation shapeRel
protected Node(SpatialPrefixTree spatialPrefixTree, String token)
protected Node(SpatialPrefixTree spatialPrefixTree, byte[] bytes, int off, int len)
public void reset(byte[] bytes, int off, int len)
public com.spatial4j.core.shape.SpatialRelation getShapeRel()
public boolean isLeaf()
public void setLeaf()
public String getTokenString()
public byte[] getTokenBytes()
public int getLevel()
public Collection<Node> getSubCells(com.spatial4j.core.shape.Shape shapeFilter)
getSubCells()
but with the results filtered by a shape. If that shape is a Point
then it
must call getSubCell(com.spatial4j.core.shape.Point)
;
Precondition: Never called when getLevel() == maxLevel.shapeFilter
- an optional filter for the returned cells.public abstract Node getSubCell(com.spatial4j.core.shape.Point p)
protected abstract Collection<Node> getSubCells()
public abstract int getSubCellsSize()
getSubCells()
.size() -- usually a constant. Should be >=2public abstract com.spatial4j.core.shape.Shape getShape()
public com.spatial4j.core.shape.Point getCenter()
public int compareTo(Node o)
compareTo
in interface Comparable<Node>
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.