Package org.apache.lucene.sandbox.facet.labels

# 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

  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 ords
  `int`
  `getOrd(FacetLabel label)`
  get ord for one label
  `int[]`
  `getOrds(FacetLabel[] labels)`
  get ords for multiple labels

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TaxonomyOrdLabelBiMap

    public TaxonomyOrdLabelBiMap(TaxonomyReader taxoReader)
    Construct

- ## Method Details

  - ### 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 interface `OrdToLabel`
    Throws:
      `IOException`

  - ### getLabels

    public FacetLabel[] getLabels(int[] ordinals) throws IOException
    Description copied from interface: `OrdToLabel`
    get labels for multiple ords
    Specified by:
      `getLabels` in interface `OrdToLabel`
    Throws:
      `IOException`

  - ### getOrd

    public int getOrd(FacetLabel label) throws IOException
    Description copied from interface: `LabelToOrd`
    get ord for one label
    Specified by:
      `getOrd` in interface `LabelToOrd`
    Throws:
      `IOException`

  - ### getOrds

    public int[] getOrds(FacetLabel[] labels) throws IOException
    Description copied from interface: `LabelToOrd`
    get ords for multiple labels
    Specified by:
      `getOrds` in interface `LabelToOrd`
    Throws:
      `IOException`