public class RangeMap<E>
extends Object
A special Map, where keys are float values defining ranges.
E.g.
map.put(0.10, "value1");
map.put(0.20, "value2");
map.put(0.15, "value3");
The value1 can be fetched for a value between 0.0 (inclusive) and 0.10 (exclusive)
Next, the lower value of the range is the higher value of the previous key (0.10), and the higher range will be the
lower range value + the key value (0.10 + 0.20)
the value2 can be fetched for a key between 0.10 (inclusive) and 0.30 (exclusive).
Next, the lower value of the range is the higher value of the previous key (0.30), and the higher range will be the
lower range value + the key value (0.30 + 0.15)
the value3 can be fetched for a key between 0.30 (inclusive) and 0.45 (exclusive).
Fetching a value for a key higher than 0.45 will return null
- Author:
- Aurelien Broszniowski