protected class PackedQuadPrefixTree.PackedQuadCell extends QuadPrefixTree.QuadCell
PackedQuadPrefixTree
.Modifier and Type | Method and Description |
---|---|
int |
compareToNoLeaf(Cell fromCell)
Equivalent to
this.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null)) . |
protected long |
concat(byte postfix) |
int |
getLevel()
Level 0 is the world (and has no parent), from then on a higher level means a smaller
cell than the level before it.
|
protected QuadPrefixTree.QuadCell |
getSubCell(org.locationtech.spatial4j.shape.Point p)
Performant implementations are expected to implement this efficiently by
considering the current cell's boundary.
|
protected Collection<Cell> |
getSubCells()
Gets the cells at the next grid cell level that covers this cell.
|
BytesRef |
getTokenBytesNoLeaf(BytesRef result)
Returns the bytes for this cell, without a leaf set.
|
BytesRef |
getTokenBytesWithLeaf(BytesRef result)
Returns the bytes for this cell, with a leaf byte if this is a leaf cell.
|
boolean |
isEnd(int level,
int shift) |
protected boolean |
isInternalPrefix(PackedQuadPrefixTree.PackedQuadCell c) |
boolean |
isPrefixOf(Cell c)
Returns if the target term is within/underneath this cell; not necessarily a direct
descendant.
|
protected org.locationtech.spatial4j.shape.Rectangle |
makeShape()
Constructs a bounding box shape out of the encoded cell
|
PackedQuadPrefixTree.PackedQuadCell |
nextCell(boolean descend)
Get the next cell in the tree without using recursion.
|
protected void |
readCell(BytesRef bytes) |
protected void |
readLeafAdjust() |
String |
toString()
Used for debugging, this will print the bits of the cell
|
concat, getGrid, getMaxLevels, getShape, getSubCellsSize
compare, equals, getNextLevelCells, getShapeRel, hashCode, isLeaf, setLeaf, setShapeRel
protected void readCell(BytesRef bytes)
readCell
in class LegacyCell
public boolean isEnd(int level, int shift)
public PackedQuadPrefixTree.PackedQuadCell nextCell(boolean descend)
protected void readLeafAdjust()
readLeafAdjust
in class LegacyCell
public BytesRef getTokenBytesWithLeaf(BytesRef result)
Cell
getTokenBytesWithLeaf
in interface Cell
getTokenBytesWithLeaf
in class LegacyCell
result
- where the result goes, or null to create newpublic BytesRef getTokenBytesNoLeaf(BytesRef result)
Cell
Cell.getTokenBytesWithLeaf(org.apache.lucene.util.BytesRef)
.
The result param is used to save object allocation, though its bytes aren't used.getTokenBytesNoLeaf
in interface Cell
getTokenBytesNoLeaf
in class LegacyCell
result
- where the result goes, or null to create newpublic int compareToNoLeaf(Cell fromCell)
Cell
this.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null))
.compareToNoLeaf
in interface Cell
compareToNoLeaf
in class LegacyCell
public int getLevel()
Cell
getLevel
in interface Cell
getLevel
in class LegacyCell
protected Collection<Cell> getSubCells()
LegacyCell
getSubCells
in class QuadPrefixTree.QuadCell
protected QuadPrefixTree.QuadCell getSubCell(org.locationtech.spatial4j.shape.Point p)
LegacyCell
Precondition: Never called when getLevel() == maxLevel. Precondition: this.getShape().relate(p) != DISJOINT.
getSubCell
in class QuadPrefixTree.QuadCell
public boolean isPrefixOf(Cell c)
Cell
isPrefixOf
in interface Cell
isPrefixOf
in class LegacyCell
c
- the termprotected boolean isInternalPrefix(PackedQuadPrefixTree.PackedQuadCell c)
protected long concat(byte postfix)
protected org.locationtech.spatial4j.shape.Rectangle makeShape()
makeShape
in class QuadPrefixTree.QuadCell
public String toString()
toString
in class LegacyCell
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.