Class LabelToOrdinal
Abstract class for storing Label->Ordinal mappings in a taxonomy.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Namespace: Lucene.Net.Facet.Taxonomy.WriterCache
Assembly: Lucene.Net.Facet.dll
Syntax
public abstract class LabelToOrdinal : object
  Constructors
| Improve this Doc View SourceLabelToOrdinal()
Default constructor.
Declaration
public LabelToOrdinal()
  Fields
| Improve this Doc View SourceINVALID_ORDINAL
Returned by GetOrdinal(FacetLabel) when the label isn't recognized.
Declaration
public const int INVALID_ORDINAL = null
  Field Value
| Type | Description | 
|---|---|
| System.Int32 | 
m_counter
How many ordinals we've seen.
Declaration
protected int m_counter
  Field Value
| Type | Description | 
|---|---|
| System.Int32 | 
Properties
| Improve this Doc View SourceMaxOrdinal
return the maximal Ordinal assigned so far
Declaration
public virtual int MaxOrdinal { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
| Improve this Doc View SourceAddLabel(FacetLabel, Int32)
Adds a new label if its not yet in the table.
Throws an 
Declaration
public abstract void AddLabel(FacetLabel label, int ordinal)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FacetLabel | label | |
| System.Int32 | ordinal | 
GetNextOrdinal()
Returns the next unassigned ordinal. The default behavior of this method is to simply increment a counter.
Declaration
public virtual int GetNextOrdinal()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
GetOrdinal(FacetLabel)
Returns the ordinal assigned to the given label, or INVALID_ORDINAL if the label cannot be found in this table.
Declaration
public abstract int GetOrdinal(FacetLabel label)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FacetLabel | label | 
Returns
| Type | Description | 
|---|---|
| System.Int32 |