org.jaitools.media.jai.rangelookup
Class RangeLookupTable<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>

java.lang.Object
  extended by org.jaitools.media.jai.rangelookup.RangeLookupTable<T,U>
Type Parameters:
T - type of the lookup (source) value range
U - 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

Nested Class Summary
static class RangeLookupTable.Builder<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>
          Builder to create an immutable lookup table.
 
Method Summary
 LookupItem<T,U> getLookupItem(T srcValue)
          Finds the LookupItem containing the given source value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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-2013. All Rights Reserved.