Closed GoogleCodeExporter closed 9 years ago
It's not clear to me why you'd use this approach, or why you'd special-case for
all these types. The idea is intended to be that you call
Range.canonical(DiscreteDomain), passing in the appropriate DiscreteDomain for
your type, before adding or removing it from the RangeSet.
If you canonicalize all Ranges you use to modify your RangeSet, your RangeSet
should only contain canonical ranges no matter how ranges get merged,
subtracted, etc.
Is there a reason that solution doesn't work for you?
Original comment by lowas...@google.com
on 12 Aug 2014 at 6:32
Ignorant question: would it make any sense to add a
canonicalize(DiscreteDomain) method to RangeSet, which would basically replace
every Range in the set with its canonical version? Maybe that would result in a
different set of ranges than you'd get if you only added canonical ranges to
the set in the first place?
Original comment by cgdecker@google.com
on 12 Aug 2014 at 7:10
lowas: Did not know about canonical. It solved my issue. In my case calling
canonical for every add is a better solution as I'm using RangeSet to reduce
memory pressure.
cgdecker: A canonicalize method is, after my fix, not necessary. So far, I have
not had a use case for that now that I know of canonical form of a Range.
Original comment by jens.ran...@tink.se
on 15 Aug 2014 at 5:42
I love the happy resolution to your problem.
Let's keep this open to consider the value of a RangeSet canonicalization
function.
Original comment by kevinb@google.com
on 15 Aug 2014 at 5:52
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:08
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:17
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:07
Original issue reported on code.google.com by
jens.ran...@tink.se
on 12 Aug 2014 at 1:59