T
- type of the lookup (source) value rangeU
- type of the result (destination) valuepublic class RangeLookupTable<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>> extends Object
Use the associated Builder class to construct a new table:
// type parameters indicate lookup (source) and result
// (destination) types
RangeLookupTable.Builder<Double, Integer> builder = RangeLookupTable.builder();
// map all values <= 0 to -1 and all values > 0 to 1
builder.add(Range.create(Double.NEGATIVE_INFINITY, false, 0.0, true), -1)
.add(Range.create(0.0, false, Double.POSITIVE_INFINITY, false), 1);
RangeLookupTable<Double, Integer> table = builder.build();
Modifier and Type | Class and Description |
---|---|
static class |
RangeLookupTable.Builder<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>
Builder to create an immutable lookup table.
|
Modifier and Type | Method and Description |
---|---|
LookupItem<T,U> |
getLookupItem(T srcValue)
Finds the LookupItem containing the given source value.
|
String |
toString() |
public LookupItem<T,U> getLookupItem(T srcValue)
srcValue
- source image valueCopyright © 2006–2018 GeoSolutions. All rights reserved.