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, getSubCellsSizecompare, equals, getNextLevelCells, getShapeRel, hashCode, isLeaf, setLeaf, setShapeRelprotected void readCell(BytesRef bytes)
readCell in class LegacyCellpublic boolean isEnd(int level,
int shift)
public PackedQuadPrefixTree.PackedQuadCell nextCell(boolean descend)
protected void readLeafAdjust()
readLeafAdjust in class LegacyCellpublic BytesRef getTokenBytesWithLeaf(BytesRef result)
CellgetTokenBytesWithLeaf in interface CellgetTokenBytesWithLeaf in class LegacyCellresult - where the result goes, or null to create newpublic BytesRef getTokenBytesNoLeaf(BytesRef result)
CellCell.getTokenBytesWithLeaf(org.apache.lucene.util.BytesRef).
The result param is used to save object allocation, though its bytes aren't used.getTokenBytesNoLeaf in interface CellgetTokenBytesNoLeaf in class LegacyCellresult - where the result goes, or null to create newpublic int compareToNoLeaf(Cell fromCell)
Cellthis.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null)).compareToNoLeaf in interface CellcompareToNoLeaf in class LegacyCellpublic int getLevel()
CellgetLevel in interface CellgetLevel in class LegacyCellprotected Collection<Cell> getSubCells()
LegacyCellgetSubCells in class QuadPrefixTree.QuadCellprotected QuadPrefixTree.QuadCell getSubCell(org.locationtech.spatial4j.shape.Point p)
LegacyCellPrecondition: Never called when getLevel() == maxLevel. Precondition: this.getShape().relate(p) != DISJOINT.
getSubCell in class QuadPrefixTree.QuadCellpublic boolean isPrefixOf(Cell c)
CellisPrefixOf in interface CellisPrefixOf in class LegacyCellc - the termprotected boolean isInternalPrefix(PackedQuadPrefixTree.PackedQuadCell c)
protected long concat(byte postfix)
protected org.locationtech.spatial4j.shape.Rectangle makeShape()
makeShape in class QuadPrefixTree.QuadCellpublic String toString()
toString in class LegacyCellCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.