|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.spatial.prefix.tree.Cell
public abstract class Cell
Represents a grid cell. These are not necessarily thread-safe, although new Cell("") (world cell) must be.
| Field Summary | |
|---|---|
protected boolean |
leaf
Always false for points. |
static byte |
LEAF_BYTE
|
protected com.spatial4j.core.shape.SpatialRelation |
shapeRel
When set via getSubCells(filter), it is the relationship between this cell and the given shape filter. |
| Constructor Summary | |
|---|---|
protected |
Cell(byte[] bytes,
int off,
int len)
|
protected |
Cell(String token)
|
| Method Summary | |
|---|---|
int |
compareTo(Cell 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 Cell |
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<Cell> |
getSubCells()
Gets the cells at the next grid cell level that cover this cell. |
Collection<Cell> |
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()
For points, this is always false. |
void |
reset(byte[] bytes,
int off,
int len)
|
void |
setLeaf()
Note: not supported at level 0. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte LEAF_BYTE
protected com.spatial4j.core.shape.SpatialRelation shapeRel
protected boolean leaf
| Constructor Detail |
|---|
protected Cell(String token)
protected Cell(byte[] bytes,
int off,
int len)
| Method Detail |
|---|
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<Cell> 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). The returned cells
should have getShapeRel() set to their relation with shapeFilter. In addition, isLeaf()
must be true when that relation is WITHIN.
Precondition: Never called when getLevel() == maxLevel.
shapeFilter - an optional filter for the returned cells.
public abstract Cell getSubCell(com.spatial4j.core.shape.Point p)
protected abstract Collection<Cell> getSubCells()
public abstract int getSubCellsSize()
getSubCells().size() -- usually a constant. Should be >=2
public abstract com.spatial4j.core.shape.Shape getShape()
public com.spatial4j.core.shape.Point getCenter()
public int compareTo(Cell o)
compareTo in interface Comparable<Cell>public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||