org.jaitools.media.jai.rangelookup
Class RangeLookupTable<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>
java.lang.Object
org.jaitools.media.jai.rangelookup.RangeLookupTable<T,U>
- Type Parameters:
T - type of the lookup (source) value rangeU - type of the result (destination) value
public class RangeLookupTable<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>
- extends Object
A lookup table for the RangeLookup operation.
It holds a collection of source value ranges, each mapped to a destination
value. Instances of this class are immutable.
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();
- Since:
- 1.0
- Author:
- Michael Bedward, Simone Giannecchini, GeoSolutions
getLookupItem
public LookupItem<T,U> getLookupItem(T srcValue)
- Finds the LookupItem containing the given source value.
- Parameters:
srcValue - source image value
- Returns:
- the LookupItem containing the source value or null if no matching
item exists
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2009-2015. All Rights Reserved.