Show / Hide Table of Contents

    Class Cell

    Represents a grid cell. These are not necessarily thread-safe, although new Cell("") (world cell) must be.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    Cell
    Namespace: Lucene.Net.Spatial.Prefix.Tree
    Assembly: Lucene.Net.Spatial.dll
    Syntax
    public abstract class Cell : IComparable<Cell>

    Constructors

    | Improve this Doc View Source

    Cell(SpatialPrefixTree, Byte[], Int32, Int32)

    Declaration
    protected Cell(SpatialPrefixTree outerInstance, byte[] bytes, int off, int len)
    Parameters
    Type Name Description
    SpatialPrefixTree outerInstance
    System.Byte[] bytes
    System.Int32 off
    System.Int32 len
    | Improve this Doc View Source

    Cell(SpatialPrefixTree, String)

    Declaration
    protected Cell(SpatialPrefixTree outerInstance, string token)
    Parameters
    Type Name Description
    SpatialPrefixTree outerInstance
    System.String token

    Fields

    | Improve this Doc View Source

    LEAF_BYTE

    Declaration
    public const byte LEAF_BYTE = null
    Field Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    m_leaf

    Always false for points.

    Declaration
    protected bool m_leaf
    Field Value
    Type Description
    System.Boolean
    Remarks

    Always false for points. Otherwise, indicate no further sub-cells are going to be provided because shapeRel is WITHIN or maxLevels or a detailLevel is hit.

    | Improve this Doc View Source

    m_outerInstance

    LUCENENET specific - we need to set the SpatialPrefixTree before calling overridden members of this class, just in case those overridden members require it. This is not possible from the subclass because the constructor of the base class runs first. So we need to move the reference here and also set it before running the normal constructor logic.

    Declaration
    protected readonly SpatialPrefixTree m_outerInstance
    Field Value
    Type Description
    SpatialPrefixTree
    | Improve this Doc View Source

    m_shapeRel

    When set via GetSubCells(IShape), it is the relationship between this cell and the given shape filter.

    Declaration
    protected SpatialRelation m_shapeRel
    Field Value
    Type Description
    SpatialRelation

    Properties

    | Improve this Doc View Source

    Center

    Declaration
    public virtual IPoint Center { get; }
    Property Value
    Type Description
    IPoint
    | Improve this Doc View Source

    IsLeaf

    For points, this is always false.

    Declaration
    public virtual bool IsLeaf { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    For points, this is always false. Otherwise this is true if there are no further cells with this prefix for the shape (always true at maxLevels).

    | Improve this Doc View Source

    Level

    Declaration
    public virtual int Level { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Shape

    Declaration
    public abstract IShape Shape { get; }
    Property Value
    Type Description
    IShape
    | Improve this Doc View Source

    ShapeRel

    Declaration
    public virtual SpatialRelation ShapeRel { get; }
    Property Value
    Type Description
    SpatialRelation
    | Improve this Doc View Source

    SubCellsSize

    GetSubCells().Count -- usually a constant. Should be >=2

    Declaration
    public abstract int SubCellsSize { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    TokenString

    Note: doesn't contain a trailing leaf byte.

    Declaration
    public virtual string TokenString { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    CompareTo(Cell)

    Declaration
    public virtual int CompareTo(Cell o)
    Parameters
    Type Name Description
    Cell o
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    GetSubCell(IPoint)

    Performant implementations are expected to implement this efficiently by considering the current cell's boundary.

    Declaration
    public abstract Cell GetSubCell(IPoint p)
    Parameters
    Type Name Description
    IPoint p
    Returns
    Type Description
    Cell
    Remarks

    Performant implementations are expected to implement this efficiently by considering the current cell's boundary. Precondition: Never called when Level == maxLevel.

    Precondition: this.Shape.Relate(p) != SpatialRelation.DISJOINT.

    | Improve this Doc View Source

    GetSubCells()

    Gets the cells at the next grid cell level that cover this cell.

    Declaration
    protected abstract ICollection<Cell> GetSubCells()
    Returns
    Type Description
    ICollection<Cell>

    A set of cells (no dups), sorted, modifiable, not empty, not null.

    Remarks

    Gets the cells at the next grid cell level that cover this cell. Precondition: Never called when Level == maxLevel.

    | Improve this Doc View Source

    GetSubCells(IShape)

    Like GetSubCells() but with the results filtered by a shape. If that shape is a then it must call GetSubCell(IPoint). The returned cells should have ShapeRel set to their relation with shapeFilter. In addition, IsLeaf must be true when that relation is .

    Precondition: Never called when Level == maxLevel.

    Declaration
    public virtual ICollection<Cell> GetSubCells(IShape shapeFilter)
    Parameters
    Type Name Description
    IShape shapeFilter

    an optional filter for the returned cells.

    Returns
    Type Description
    ICollection<Cell>

    A set of cells (no dups), sorted. Not Modifiable.

    | Improve this Doc View Source

    GetTokenBytes()

    Note: doesn't contain a trailing leaf byte.

    Declaration
    public virtual byte[] GetTokenBytes()
    Returns
    Type Description
    System.Byte[]
    | Improve this Doc View Source

    Reset(Byte[], Int32, Int32)

    Declaration
    public virtual void Reset(byte[] bytes, int off, int len)
    Parameters
    Type Name Description
    System.Byte[] bytes
    System.Int32 off
    System.Int32 len
    | Improve this Doc View Source

    SetLeaf()

    Note: not supported at level 0.

    Declaration
    public virtual void SetLeaf()
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)