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, thisCell
finalize, getClass, notify, notifyAll, wait, wait, wait
forEachRemaining
public int getLevel()
Cell
getLevel
in interface Cell
getLevel
in interface NumberRangePrefixTree.UnitNRShape
public org.locationtech.spatial4j.shape.SpatialRelation getShapeRel()
Cell
CellIterator
. Arguably it belongs there but it's very convenient here.getShapeRel
in interface Cell
public void setShapeRel(org.locationtech.spatial4j.shape.SpatialRelation rel)
Cell
Cell.getShapeRel()
.setShapeRel
in interface Cell
public boolean isLeaf()
Cell
public void setLeaf()
Cell
public NumberRangePrefixTree.UnitNRShape getShape()
Cell
public 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
result
- where the result goes, or null to create newpublic BytesRef getTokenBytesWithLeaf(BytesRef result)
Cell
getTokenBytesWithLeaf
in interface Cell
result
- where the result goes, or null to create newpublic boolean isPrefixOf(Cell c)
Cell
isPrefixOf
in interface Cell
c
- the termpublic int compareToNoLeaf(Cell fromCell)
Cell
this.getTokenBytesNoLeaf(null).compareTo(fromCell.getTokenBytesNoLeaf(null))
.compareToNoLeaf
in interface Cell
public CellIterator getNextLevelCells(org.locationtech.spatial4j.shape.Shape shapeFilter)
Cell
shapeFilter
. 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 Cell
shapeFilter
- an optional filter for the returned cells.public int getValAtLevel(int level)
NumberRangePrefixTree.UnitNRShape
getValAtLevel
in interface NumberRangePrefixTree.UnitNRShape
public NumberRangePrefixTree.NRCell getShapeAtLevel(int level)
NumberRangePrefixTree.UnitNRShape
getShapeAtLevel
in interface NumberRangePrefixTree.UnitNRShape
public NumberRangePrefixTree.UnitNRShape roundToLevel(int targetLevel)
NumberRangePrefixTree.NRShape
roundToLevel
in interface NumberRangePrefixTree.NRShape
roundToLevel
in interface NumberRangePrefixTree.UnitNRShape
public org.locationtech.spatial4j.shape.SpatialRelation relate(org.locationtech.spatial4j.shape.Shape shape)
relate
in interface org.locationtech.spatial4j.shape.Shape
public org.locationtech.spatial4j.shape.SpatialRelation relate(NumberRangePrefixTree.UnitNRShape lv)
public org.locationtech.spatial4j.shape.SpatialRelation relate(NumberRangePrefixTree.SpanUnitsNRShape spanShape)
public NumberRangePrefixTree.UnitNRShape clone()
NumberRangePrefixTree.UnitNRShape
clone
in interface NumberRangePrefixTree.UnitNRShape
clone
in class Object
public 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.Shape
public boolean hasArea()
hasArea
in interface org.locationtech.spatial4j.shape.Shape
public double getArea(org.locationtech.spatial4j.context.SpatialContext ctx)
getArea
in interface org.locationtech.spatial4j.shape.Shape
public org.locationtech.spatial4j.shape.Point getCenter()
getCenter
in interface org.locationtech.spatial4j.shape.Shape
public org.locationtech.spatial4j.shape.Shape getBuffered(double distance, org.locationtech.spatial4j.context.SpatialContext ctx)
getBuffered
in interface org.locationtech.spatial4j.shape.Shape
public boolean isEmpty()
isEmpty
in interface org.locationtech.spatial4j.shape.Shape
public boolean equals(Object obj)
public org.locationtech.spatial4j.context.SpatialContext getContext()
getContext
in interface org.locationtech.spatial4j.shape.Shape
public String toString()
NumberRangePrefixTree.NRShape
NumberRangePrefixTree.parseShape(String)
.toString
in interface NumberRangePrefixTree.NRShape
toString
in class Object
public String toStringDebug()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.