Omri
Omri

Reputation: 41

guava RangeMap ranges mapped to multiple values

I'm trying to find a data structure such that I will get this:

[1, 100) -> A
merge with
[2, 50) -> B

will become like this:

[1, 2) -> A,
[2, 50) -> A,B
[50, 100) -> b

I'm using RangeMap and I want to merge ranges like in the example but it didn't help, I also went through the docs but didn't find a relevant solution. Is there a solution within this data structure or is there a better one I can use? thanks!

Upvotes: 2

Views: 292

Answers (0)

Related Questions