Class LabelToOrdinal

java.lang.Object
org.apache.lucene.facet.taxonomy.writercache.LabelToOrdinal
Direct Known Subclasses:
CompactLabelToOrdinal

public abstract class LabelToOrdinal extends Object
Abstract class for storing Label->Ordinal mappings in a taxonomy.
  • Field Details

  • Constructor Details

    • LabelToOrdinal

      public LabelToOrdinal()
      Default constructor.
  • Method Details

    • getMaxOrdinal

      public int getMaxOrdinal()
      return the maximal Ordinal assigned so far
    • getNextOrdinal

      public int getNextOrdinal()
      Returns the next unassigned ordinal. The default behavior of this method is to simply increment a counter.
    • addLabel

      public abstract void addLabel(FacetLabel label, int ordinal)
      Adds a new label if its not yet in the table. Throws an IllegalArgumentException if the same label with a different ordinal was previoulsy added to this table.
    • getOrdinal

      public abstract int getOrdinal(FacetLabel label)
      Returns the ordinal assigned to the given label, or INVALID_ORDINAL if the label cannot be found in this table.