Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    LabelToOrdinal
    CompactLabelToOrdinal
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.