Class LabelToOrdinal
Abstract class for storing Label->Ordinal mappings in a taxonomy.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy.WriterCache
Assembly: Lucene.Net.Facet.dll
Syntax
public abstract class LabelToOrdinal
Constructors
LabelToOrdinal()
Default constructor.
Declaration
protected LabelToOrdinal()
Fields
INVALID_ORDINAL
Returned by GetOrdinal(FacetLabel) when the label isn't recognized.
Declaration
public const int INVALID_ORDINAL = -2
Field Value
Type | Description |
---|---|
int |
m_counter
How many ordinals we've seen.
Declaration
protected int m_counter
Field Value
Type | Description |
---|---|
int |
Properties
MaxOrdinal
return the maximal Ordinal assigned so far
Declaration
public virtual int MaxOrdinal { get; }
Property Value
Type | Description |
---|---|
int |
Methods
AddLabel(FacetLabel, int)
Adds a new label if its not yet in the table. Throws an ArgumentException if the same label with a different ordinal was previoulsy added to this table.
Declaration
public abstract void AddLabel(FacetLabel label, int ordinal)
Parameters
Type | Name | Description |
---|---|---|
FacetLabel | label | |
int | 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 |
---|---|
int |
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 |
---|---|
int |