Interface NumberRangePrefixTree.UnitNRShape

All Superinterfaces:
Cloneable, Comparable<NumberRangePrefixTree.UnitNRShape>, NumberRangePrefixTree.NRShape, org.locationtech.spatial4j.shape.Shape
All Known Implementing Classes:
NumberRangePrefixTree.NRCell
Enclosing class:
NumberRangePrefixTree

public static interface NumberRangePrefixTree.UnitNRShape extends NumberRangePrefixTree.NRShape, Comparable<NumberRangePrefixTree.UnitNRShape>
A unit value Shape implemented as a stack of numbers, one for each level in the prefix tree. It directly corresponds to a Cell. Spatially speaking, it's analogous to a Point but 1D and has some precision width.
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Method Details

    • getLevel

      int getLevel()
      Get the prefix tree level, the higher the more precise. 0 means the world (universe).
    • getValAtLevel

      int getValAtLevel(int level)
      Gets the value at the specified level of this unit. level must be >= 0 and <= getLevel().
    • getShapeAtLevel

      NumberRangePrefixTree.UnitNRShape getShapeAtLevel(int level)
      Gets an ancestor at the specified level. It shares state, so you may want to clone() it.
    • roundToLevel

      NumberRangePrefixTree.UnitNRShape roundToLevel(int targetLevel)
      Description copied from interface: NumberRangePrefixTree.NRShape
      Returns this shape rounded to the target level. If we are already more course than the level then the shape is simply returned. The result may refer to internal state of the argument so you may want to clone it.
      Specified by:
      roundToLevel in interface NumberRangePrefixTree.NRShape
    • clone

      Deep clone