protected class NumberRangePrefixTree.NRCell extends CellIterator implements Cell, NumberRangePrefixTree.UnitNRShape
nextCell, thisCell| Modifier and Type | Method and Description |
|---|---|
NumberRangePrefixTree.UnitNRShape |
clone()
Deep clone
|
int |
compareTo(NumberRangePrefixTree.UnitNRShape o) |
int |
compareToNoLeaf(Cell fromCell)
Equivalent to
this.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null)). |
boolean |
equals(Object obj) |
double |
getArea(org.locationtech.spatial4j.context.SpatialContext ctx) |
org.locationtech.spatial4j.shape.Rectangle |
getBoundingBox() |
org.locationtech.spatial4j.shape.Shape |
getBuffered(double distance,
org.locationtech.spatial4j.context.SpatialContext ctx) |
org.locationtech.spatial4j.shape.Point |
getCenter() |
org.locationtech.spatial4j.context.SpatialContext |
getContext() |
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.
|
CellIterator |
getNextLevelCells(org.locationtech.spatial4j.shape.Shape shapeFilter)
Gets the cells at the next grid cell level underneath this one, optionally filtered by
shapeFilter. |
NumberRangePrefixTree.UnitNRShape |
getShape()
Gets the shape for this cell; typically a Rectangle.
|
NumberRangePrefixTree.NRCell |
getShapeAtLevel(int level)
Gets an ancestor at the specified level.
|
org.locationtech.spatial4j.shape.SpatialRelation |
getShapeRel()
Gets the relationship this cell has with the shape from which it was filtered from, assuming it came from a
CellIterator. |
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.
|
int |
getValAtLevel(int level)
Gets the value at the specified level of this unit.
|
boolean |
hasArea() |
int |
hashCode() |
boolean |
hasNext() |
boolean |
isEmpty() |
boolean |
isLeaf()
Some cells are flagged as leaves, which are indexed as such.
|
boolean |
isPrefixOf(Cell c)
Returns if the target term is within/underneath this cell; not necessarily a direct
descendant.
|
org.locationtech.spatial4j.shape.SpatialRelation |
relate(NumberRangePrefixTree.SpanUnitsNRShape spanShape) |
org.locationtech.spatial4j.shape.SpatialRelation |
relate(NumberRangePrefixTree.UnitNRShape lv) |
org.locationtech.spatial4j.shape.SpatialRelation |
relate(org.locationtech.spatial4j.shape.Shape shape) |
NumberRangePrefixTree.UnitNRShape |
roundToLevel(int targetLevel)
Returns this shape rounded to the target level.
|
void |
setLeaf()
Set this cell to be a leaf.
|
void |
setShapeRel(org.locationtech.spatial4j.shape.SpatialRelation rel)
See
Cell.getShapeRel(). |
String |
toString()
The result should be parseable by
NumberRangePrefixTree.parseShape(String). |
String |
toStringDebug()
Configure your IDE to use this.
|
next, nextFrom, remove, thisCellfinalize, getClass, notify, notifyAll, wait, wait, waitforEachRemainingpublic int getLevel()
CellgetLevel in interface CellgetLevel in interface NumberRangePrefixTree.UnitNRShapepublic org.locationtech.spatial4j.shape.SpatialRelation getShapeRel()
CellCellIterator. Arguably it belongs there but it's very convenient here.getShapeRel in interface Cellpublic void setShapeRel(org.locationtech.spatial4j.shape.SpatialRelation rel)
CellCell.getShapeRel().setShapeRel in interface Cellpublic boolean isLeaf()
Cellpublic void setLeaf()
Cellpublic NumberRangePrefixTree.UnitNRShape getShape()
Cellpublic 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 Cellresult - where the result goes, or null to create newpublic BytesRef getTokenBytesWithLeaf(BytesRef result)
CellgetTokenBytesWithLeaf in interface Cellresult - where the result goes, or null to create newpublic boolean isPrefixOf(Cell c)
CellisPrefixOf in interface Cellc - the termpublic int compareToNoLeaf(Cell fromCell)
Cellthis.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null)).compareToNoLeaf in interface Cellpublic CellIterator getNextLevelCells(org.locationtech.spatial4j.shape.Shape shapeFilter)
CellshapeFilter. The returned cells should have Cell.getShapeRel() set to
their relation with shapeFilter. In addition, for non-points Cell.isLeaf()
must be true when that relation is WITHIN.
IMPORTANT: Cells returned from this iterator can be shared, as well as the bytes.
Precondition: Never called when getLevel() == maxLevel.
getNextLevelCells in interface CellshapeFilter - an optional filter for the returned cells.public int getValAtLevel(int level)
NumberRangePrefixTree.UnitNRShapegetValAtLevel in interface NumberRangePrefixTree.UnitNRShapepublic NumberRangePrefixTree.NRCell getShapeAtLevel(int level)
NumberRangePrefixTree.UnitNRShapegetShapeAtLevel in interface NumberRangePrefixTree.UnitNRShapepublic NumberRangePrefixTree.UnitNRShape roundToLevel(int targetLevel)
NumberRangePrefixTree.NRShaperoundToLevel in interface NumberRangePrefixTree.NRShaperoundToLevel in interface NumberRangePrefixTree.UnitNRShapepublic org.locationtech.spatial4j.shape.SpatialRelation relate(org.locationtech.spatial4j.shape.Shape shape)
relate in interface org.locationtech.spatial4j.shape.Shapepublic org.locationtech.spatial4j.shape.SpatialRelation relate(NumberRangePrefixTree.UnitNRShape lv)
public org.locationtech.spatial4j.shape.SpatialRelation relate(NumberRangePrefixTree.SpanUnitsNRShape spanShape)
public NumberRangePrefixTree.UnitNRShape clone()
NumberRangePrefixTree.UnitNRShapeclone in interface NumberRangePrefixTree.UnitNRShapeclone in class Objectpublic int compareTo(NumberRangePrefixTree.UnitNRShape o)
compareTo in interface Comparable<NumberRangePrefixTree.UnitNRShape>public org.locationtech.spatial4j.shape.Rectangle getBoundingBox()
getBoundingBox in interface org.locationtech.spatial4j.shape.Shapepublic boolean hasArea()
hasArea in interface org.locationtech.spatial4j.shape.Shapepublic double getArea(org.locationtech.spatial4j.context.SpatialContext ctx)
getArea in interface org.locationtech.spatial4j.shape.Shapepublic org.locationtech.spatial4j.shape.Point getCenter()
getCenter in interface org.locationtech.spatial4j.shape.Shapepublic org.locationtech.spatial4j.shape.Shape getBuffered(double distance,
org.locationtech.spatial4j.context.SpatialContext ctx)
getBuffered in interface org.locationtech.spatial4j.shape.Shapepublic boolean isEmpty()
isEmpty in interface org.locationtech.spatial4j.shape.Shapepublic boolean equals(Object obj)
public org.locationtech.spatial4j.context.SpatialContext getContext()
getContext in interface org.locationtech.spatial4j.shape.Shapepublic String toString()
NumberRangePrefixTree.NRShapeNumberRangePrefixTree.parseShape(String).toString in interface NumberRangePrefixTree.NRShapetoString in class Objectpublic String toStringDebug()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.