|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.facet.taxonomy.writercache.LabelToOrdinal
public abstract class LabelToOrdinal
Abstract class for storing Label->Ordinal mappings in a taxonomy.
Field Summary | |
---|---|
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 Summary | |
---|---|
LabelToOrdinal()
Default constructor. |
Method Summary | |
---|---|
abstract void |
addLabel(FacetLabel label,
int ordinal)
Adds a new label if its 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int counter
public static final int INVALID_ORDINAL
getOrdinal(org.apache.lucene.facet.taxonomy.FacetLabel)
when the label isn't
recognized.
Constructor Detail |
---|
public LabelToOrdinal()
Method Detail |
---|
public int getMaxOrdinal()
public int getNextOrdinal()
public abstract void addLabel(FacetLabel label, int ordinal)
IllegalArgumentException
if the same label with
a different ordinal was previoulsy added to this table.
public abstract int getOrdinal(FacetLabel label)
INVALID_ORDINAL
if the label cannot be found in this table.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |