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
   
  
  
    Inherited Members
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
   
  
  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
  
  Fields
  
  
    |
    Improve this Doc
  
  
    View Source
  
  LEAF_BYTE
  
  
  Declaration
  
    public const byte LEAF_BYTE = 43
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Byte | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  m_leaf
  
  
  Declaration
  
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
    |
    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
  
  
    |
    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 | 
      
    
    
      
        | Spatial4n.Core.Shapes.SpatialRelation | 
         | 
      
    
  
  Properties
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Center
  
  
  Declaration
  
    public virtual IPoint Center { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Spatial4n.Core.Shapes.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 | 
         | 
      
    
  
  
  
  
    |
    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 | 
      
    
    
      
        | Spatial4n.Core.Shapes.IShape | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ShapeRel
  
  
  Declaration
  
    public virtual SpatialRelation ShapeRel { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Spatial4n.Core.Shapes.SpatialRelation | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  SubCellsSize
  
  
  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 | 
         | 
      
    
  
  Overrides
  System.Object.Equals(System.Object)
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetHashCode()
  
  
  Declaration
  
    public override int GetHashCode()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Int32 | 
         | 
      
    
  
  Overrides
  System.Object.GetHashCode()
  
    |
    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 | 
      
    
    
      
        | Spatial4n.Core.Shapes.IPoint | 
        p | 
         | 
      
    
  
  Returns
  
  
  
  
    |
    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 | 
      
    
    
      
        | System.Collections.Generic.ICollection<Cell> | 
        A set of cells (no dups), sorted, modifiable, not empty, not null. 
 | 
      
    
  
  
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetSubCells(IShape)
  Like GetSubCells() but with the results filtered by a shape. If
that shape is a Spatial4n.Core.Shapes.IPoint 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 Spatial4n.Core.Shapes.SpatialRelation.WITHIN.
Precondition: Never called when Level == maxLevel.
 
  
  Declaration
  
    public virtual ICollection<Cell> GetSubCells(IShape shapeFilter)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Spatial4n.Core.Shapes.IShape | 
        shapeFilter | 
        an optional filter for the returned cells. 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Collections.Generic.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 | 
         | 
      
    
  
  Overrides
  System.Object.ToString()
  Implements
  
      System.IComparable<T>