Class SimpleLookupTable

  • All Implemented Interfaces:
    LookupTable

    public class SimpleLookupTable
    extends java.lang.Object
    implements LookupTable
    A simple lookup table which assumes the keys scale linearly with an offset
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleLookupTable​(double[] values)
      Constructor
      SimpleLookupTable​(double[] values, double offset)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get​(double key)
      Get the value of the key closest to the passed in key
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleLookupTable

        public SimpleLookupTable​(double[] values,
                                 double offset)
        Constructor
        Parameters:
        values - the values of the lookup table
        offset - the offset to subtract from the keys before using the lookup table. Defaults to 0
      • SimpleLookupTable

        public SimpleLookupTable​(double[] values)
        Constructor
        Parameters:
        values - the values of the lookup table
    • Method Detail

      • get

        public double get​(double key)
        Description copied from interface: LookupTable
        Get the value of the key closest to the passed in key
        Specified by:
        get in interface LookupTable
        Parameters:
        key - the key to lookup
        Returns:
        the value at the key
        See Also:
        LookupTable.get(double)