mbedward / jaitools

Raster image processing for Java developers
17 stars 15 forks source link

Make RangeLookupTable immutable #211

Closed mbedward closed 11 years ago

mbedward commented 11 years ago

Original author: michael.bedward@gmail.com (January 15, 2013 02:31:45)

All the usual advantages of having an immutable object apply, and it fits with Simone's recent changes to make the associated RangeLookup operator thread safe.

Add one or more methods to return a new table based on an existing table to replace in-place updating (see issue 198 which this issue will supersede).

Original issue: http://code.google.com/p/jaitools/issues/detail?id=213

mbedward commented 11 years ago

Added a Builder class within RangeLookupTable (only in local repo at the moment). Creates some generic type parameter hell in the code but actually reduces type param overload a little for clients.

Think we can take this opportunity to add another option for lookups: pass-through of source values which do not match lookup ranges.

simboss commented 11 years ago

2 thumbs up

mbedward commented 11 years ago

Cool - I will make it so

mbedward commented 11 years ago

Decided to strip back RangeLookupTable so that it manages building, sorting and searching the list of LookupItems. Default value and pass-through option can be made parameters for the RangeLookup operation.

mbedward commented 11 years ago

Done. Included with version 1.3.1