Interface ReverseLookupColumnSource<DATA_TYPE,EXTRA_VALUE_TYPE>

All Superinterfaces:
ChunkSource<Values>, ChunkSource.WithPrev<Values>, ColumnSource<DATA_TYPE>, ElementSource<DATA_TYPE>, FillContextMaker, GetContextMaker, LongBitmapStringSet.ReversibleLookup<DATA_TYPE>, Releasable, TupleExporter<DATA_TYPE>, TupleSource<DATA_TYPE>

public interface ReverseLookupColumnSource<DATA_TYPE,EXTRA_VALUE_TYPE> extends ColumnSource<DATA_TYPE>, LongBitmapStringSet.ReversibleLookup<DATA_TYPE>
Common interface for column sources that provide a reverse-lookup function (value to int key). Note that int keys are used because this is intended for column sources with a small, contiguous key range starting from 0 and well shorter than Integer.MAX_VALUE.
  • Method Details

    • getReverseLookup

      ToIntFunction<DATA_TYPE> getReverseLookup(int highestKeyNeeded)
      Get a reverse-lookup function for all non-null values stored in this column source at keys <= highestKeyNeeded.
      Parameters:
      highestKeyNeeded - The highest key needed in the result map
      Returns:
      A reverse-lookup function that has all values defined for keys in [0, highestKeyNeeded]
    • getExtra

      EXTRA_VALUE_TYPE getExtra()
      Get an implementation-defined "extra value" associated with this column source.
    • rget

      default int rget(int highestIndex, DATA_TYPE value)
      Perform a reverse lookup
      Specified by:
      rget in interface LongBitmapStringSet.ReversibleLookup<DATA_TYPE>
      Parameters:
      highestIndex - The highest key needed for the lookup
      value - The value we are looking up
      Returns:
      The key, between 0 and highestIndex, for the value. A value outside this range if the value has no mapping in the range.