Class RangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>

All Implemented Interfaces:
MergeAndCopyStructure<RangeStructure<K,V,R>>

public class RangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> extends AbstractMapStructure<K,V,R> implements MergeAndCopyStructure<RangeStructure<K,V,R>>
A SearchStructure that maps ranges to nested SearchStructures. A RangeStructure is configured by a RangeType to define how the bounds of the contained ranges should be handled.

Ranges are set up by putting one or more key-value pairs into this structure. The key is of a comparable data type (of course, as it defines a range). The value is a nested SearchStructure. The given key defines one of the bounds of a range, which one depends on the RangeType.

Example: In a RangeType.LOWER_BOUND_EQUAL RangeStructure (keys of type Integer) by calling put(10, value1) and put(25, value2), two ranges are defined: [10..24] and [25..infinity]. Calls to get(Object) with the keys 10, 24 and all in between will yield value1 as a result. Calls to get(Object) with the keys 25 and higher will yield value2 respectively. The keys 9 and lower, however, will return an EmptySearchStructure.

See Also: