Package com.thegongoliers.math.lookup
Class SimpleLookupTable
- java.lang.Object
-
- com.thegongoliers.math.lookup.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)
ConstructorSimpleLookupTable(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
-
-
-
Constructor Detail
-
SimpleLookupTable
public SimpleLookupTable(double[] values, double offset)
Constructor- Parameters:
values
- the values of the lookup tableoffset
- 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 interfaceLookupTable
- Parameters:
key
- the key to lookup- Returns:
- the value at the key
- See Also:
LookupTable.get(double)
-
-