|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.internal.tableindex.SearchStructure<R>
org.faktorips.runtime.internal.tableindex.AbstractMapStructure<K,V,R>
org.faktorips.runtime.internal.tableindex.RangeStructure<K,V,R>
public class RangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<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.
RangeType| Method Summary | ||
|---|---|---|
RangeStructure<K,V,R> |
copy()
This method copies the object which calls it. |
|
static
|
create(RangeType keyType)
Creates an empty RangeStructure. |
|
static
|
createWith(RangeType keyType,
K key,
V value)
Creates a new RangeStructure and adds the given key-value pair. |
|
SearchStructure<R> |
get(Object key)
Returns the nested SearchStructure for the given key. |
|
protected TreeMap<K,V> |
getMap()
|
|
void |
merge(RangeStructure<K,V,R> map)
Merging adds the contents of the otherMergable to this object. |
|
| Methods inherited from class org.faktorips.runtime.internal.tableindex.AbstractMapStructure |
|---|
emptyResult, fillCopy, get, getValidResult, merge, put |
| Methods inherited from class org.faktorips.runtime.internal.tableindex.SearchStructure |
|---|
getUnique, getUnique |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> RangeStructure<K,V,R> create(RangeType keyType)
RangeStructure.
public static <K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> RangeStructure<K,V,R> createWith(RangeType keyType,
K key,
V value)
RangeStructure and adds the given key-value pair.
public SearchStructure<R> get(Object key)
SearchStructureSearchStructure for the given key. This method never returns
null. If no value exists for a given key an EmptySearchStructure is
returned as a fall-back.
get in class SearchStructure<R>key - The key for the requested nested SearchStructure
SearchStructure or an EmptySearchStructure if the key does
not exist.protected TreeMap<K,V> getMap()
getMap in class AbstractMapStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>public void merge(RangeStructure<K,V,R> map)
MergeAndCopyStructureSearchStructure
deletes no content, instead equal values are being merged recursively.
merge in interface MergeAndCopyStructure<RangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>>map - The object that should be merged into this objectpublic RangeStructure<K,V,R> copy()
MergeAndCopyStructureMergeAndCopyStructure.copy().
copy in interface MergeAndCopyStructure<RangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||