wachub / jaitools

Automatically exported from code.google.com/p/jaitools
0 stars 0 forks source link

Allow range lookup to preserve source #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now RangeLookupTable when asked to provide a dest value for a source one 
that falls outside the provided ranges can either throw an exception or return 
a default value.

I would like to add the possibility to also just return the source value, after 
a type change as needed.

I am attaching a tentive implementation with some tests for trunk.

Original issue reported on code.google.com by simboss1@gmail.com on 9 Sep 2011 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago
Apologies for the year-long delay Simone :) Just looking at this for the 1.3.0 
release.

The patch looks good but I think it would be safest to remove the setters from 
the table class (including the setDefaultValue method that was already there). 

Original comment by michael.bedward@gmail.com on 24 Sep 2012 at 2:12

GoogleCodeExporter commented 9 years ago
That last comment should have also mentioned that in place of the add(range, 
destValue) method the table constructors would take a collection of LookupItems.

Original comment by michael.bedward@gmail.com on 24 Sep 2012 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by michael.bedward@gmail.com on 24 Sep 2012 at 2:41

GoogleCodeExporter commented 9 years ago
Took some time to look into the old patch as well as the comments. I am in 
favour of making this class immutable if that is the goal.

My only concern is here to allow for cases where I want to retain some input 
values while changing some others, that's why my changes.

Original comment by simboss1@gmail.com on 14 Jan 2013 at 1:08

GoogleCodeExporter commented 9 years ago
I'll go ahead and make it immutable (will create a new issue which will 
eventually supersede this one). 

Can you give me a "keep some / change some" use case ? That would help to 
design one or more new methods to do the equivalent thing by returning new 
immutable instances.

Original comment by michael.bedward@gmail.com on 15 Jan 2013 at 2:28

GoogleCodeExporter commented 9 years ago
See issue 213 (immutable class)

Original comment by michael.bedward@gmail.com on 15 Jan 2013 at 2:32

GoogleCodeExporter commented 9 years ago
Moved issue to GitHub issue tracker
https://github.com/mbedward/jaitools/issues

Original comment by michael.bedward@gmail.com on 21 Jan 2013 at 3:06