Class TaxonomyOrdLabelBiMap
- java.lang.Object
-
- org.apache.lucene.sandbox.facet.labels.TaxonomyOrdLabelBiMap
-
- All Implemented Interfaces:
LabelToOrd
,OrdToLabel
public final class TaxonomyOrdLabelBiMap extends Object implements OrdToLabel, LabelToOrd
Map taxonomy labels to ordinals.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from interface org.apache.lucene.sandbox.facet.labels.LabelToOrd
INVALID_ORD
-
-
Constructor Summary
Constructors Constructor Description TaxonomyOrdLabelBiMap(TaxonomyReader taxoReader)
Construct
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FacetLabel
getLabel(int ordinal)
get label of one ord TODO: what do we return when ordinal is not valid? null?FacetLabel[]
getLabels(int[] ordinals)
get labels for multiple ordsint
getOrd(FacetLabel label)
get ord for one labelint[]
getOrds(FacetLabel[] labels)
get ords for multiple labels
-
-
-
Constructor Detail
-
TaxonomyOrdLabelBiMap
public TaxonomyOrdLabelBiMap(TaxonomyReader taxoReader)
Construct
-
-
Method Detail
-
getLabel
public FacetLabel getLabel(int ordinal) throws IOException
Description copied from interface:OrdToLabel
get label of one ord TODO: what do we return when ordinal is not valid? null?- Specified by:
getLabel
in interfaceOrdToLabel
- Throws:
IOException
-
getLabels
public FacetLabel[] getLabels(int[] ordinals) throws IOException
Description copied from interface:OrdToLabel
get labels for multiple ords- Specified by:
getLabels
in interfaceOrdToLabel
- Throws:
IOException
-
getOrd
public int getOrd(FacetLabel label) throws IOException
Description copied from interface:LabelToOrd
get ord for one label- Specified by:
getOrd
in interfaceLabelToOrd
- Throws:
IOException
-
getOrds
public int[] getOrds(FacetLabel[] labels) throws IOException
Description copied from interface:LabelToOrd
get ords for multiple labels- Specified by:
getOrds
in interfaceLabelToOrd
- Throws:
IOException
-
-