T
- lookup (source) value typeU
- result (destination) valuetypepublic static class RangeLookupTable.Builder<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>> extends Object
Constructor and Description |
---|
RangeLookupTable.Builder()
Creates a new builder.
|
Modifier and Type | Method and Description |
---|---|
RangeLookupTable.Builder |
add(Range srcRange,
U resultValue)
Adds a new lookup defined by a range of source values mapping to a
result value.
|
RangeLookupTable<T,U> |
build()
Creates a new table that will hold the lookup items added to
this builder.
|
public RangeLookupTable.Builder()
public RangeLookupTable<T,U> build()
public RangeLookupTable.Builder add(Range srcRange, U resultValue)
[0, 5) => 2 [5, 10] => 1 (10, 20] => 2Where a new range is completely overlapped by existing ranges it will be ignored.
Note that it is possible to end up with unintended gaps in lookup coverage. If the first range in the above example had been the half-open interval (5, 10] rather than the closed interval [5, 10] then the following would have resulted:
[0, 5) => 2 (5, 10] => 1 (10, 20] => 2In this case the value 5 would not be matched.
srcRange
- the source value rangeresultValue
- the destination valueCopyright © 2006–2015 GeoSolutions. All rights reserved.