public abstract class LabelToOrdinal extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
counter
How many ordinals we've seen.
|
static int |
INVALID_ORDINAL
Returned by
getOrdinal(org.apache.lucene.facet.taxonomy.FacetLabel) when the label isn't
recognized. |
Constructor and Description |
---|
LabelToOrdinal()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addLabel(FacetLabel label,
int ordinal)
Adds a new label if it is not yet in the table.
|
int |
getMaxOrdinal()
return the maximal Ordinal assigned so far
|
int |
getNextOrdinal()
Returns the next unassigned ordinal.
|
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. |
protected int counter
public static final int INVALID_ORDINAL
getOrdinal(org.apache.lucene.facet.taxonomy.FacetLabel)
when the label isn't
recognized.public int getMaxOrdinal()
public int getNextOrdinal()
public abstract void addLabel(FacetLabel label, int ordinal)
IllegalArgumentException
if the same label with
a different ordinal was previously added to this table.public abstract int getOrdinal(FacetLabel label)
INVALID_ORDINAL
if the label cannot be found in this table.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.