|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaitools.media.jai.rangelookup.RangeLookupTable.Builder<T,U>
T - lookup (source) value typeU - result (destination) valuetypepublic static class RangeLookupTable.Builder<T extends Number & Comparable<? super T>,U extends Number & Comparable<? super U>>
Builder to create an immutable lookup table.
| Constructor Summary | |
|---|---|
RangeLookupTable.Builder()
Creates a new builder. |
|
| Method Summary | |
|---|---|
RangeLookupTable.Builder |
add(Range<T> 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RangeLookupTable.Builder()
| Method Detail |
|---|
public RangeLookupTable<T,U> build()
public RangeLookupTable.Builder add(Range<T> srcRange,
U resultValue)
[0, 5) => 2
[5, 10] => 1
(10, 20] => 2
Where 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] => 2
In this case the value 5 would not be matched.
srcRange - the source value rangeresultValue - the destination value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||