|
||||||||||
| 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<org.faktorips.runtime.internal.tableindex.TwoColumnRange<K>,V,R>
org.faktorips.runtime.internal.tableindex.TwoColumnRangeStructure<K,V,R>
public class TwoColumnRangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>
A SearchStructure that maps ranges (keys) to nested SearchStructures i.e. sets of values. Each range in a
TwoColumnRangeStructure is defined by lower and upper bound. Thus there might be "gaps"
in between ranges, in contrast to RangeStructures. The
TwoColumnRangeStructure also supports overlapping ranges, as well as "infinite" ranges.
Ranges are set up by putting one or more key-key-value tuples into this structure. The keys are
of a comparable data type (of course, as they define a range). The value is a nested
SearchStructure. The first key defines the lower bound, the second the upper bound of the
range. The value can be retrieved by calling get(Object) with a key inside the defined
range.
Example: In a TwoColumnRangeStructure by calling put(10, 24, "AAA") and
put(25, 50, "BBB"), two ranges are defined. Calls to get(Object) with the:
EmptySearchStructure.
Overlapping ranges: In a TwoColumnRangeStructure by calling
put(0, 100, "AAA") and put(50, 200, "BBB"), two ranges are defined.
Calls to get(Object) with keys:
EmptySearchStructure.
Calling put(null, 100, "AAA") defines a range from negative infinity to 100, that
maps to {"AAA"}. This range includes all values less than and equal to 100. Calling
put(0, null, "BBB") in turn defines a range from 0 to positive infinity. This range
includes all values greater than and equal to 0.
| Method Summary | ||
|---|---|---|
TwoColumnRangeStructure<K,V,R> |
copy()
This method copies the object which calls it. |
|
static
|
create()
Creates an empty TwoColumnRangeStructure. |
|
static
|
createWith(K lowerBound,
K upperBound,
V value)
Creates a new TwoColumnRangeStructure and adds the given range-value pair. |
|
SearchStructure<R> |
get(Object key)
Returns the nested SearchStructure for the given key. |
|
protected TreeMap<org.faktorips.runtime.internal.tableindex.TwoColumnRange<K>,V> |
getMap()
|
|
void |
merge(TwoColumnRangeStructure<K,V,R> map)
Merging adds the contents of the otherMergable to this object. |
|
void |
put(K lower,
K upper,
boolean lowerInclusive,
boolean upperInclusive,
V value)
Defines a range that maps to the given value. |
|
void |
put(K lower,
K upper,
V value)
Defines a range that maps to the given value. |
|
void |
put(org.faktorips.runtime.internal.tableindex.TwoColumnRange<K> key,
V value)
Puts a new element in the map. |
|
| Methods inherited from class org.faktorips.runtime.internal.tableindex.AbstractMapStructure |
|---|
emptyResult, fillCopy, get, getValidResult, merge |
| 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> TwoColumnRangeStructure<K,V,R> create()
TwoColumnRangeStructure.
public static <K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> TwoColumnRangeStructure<K,V,R> createWith(K lowerBound,
K upperBound,
V value)
TwoColumnRangeStructure and adds the given range-value pair.
public void put(K lower,
K upper,
V value)
lower - the lower bound of the range (included)upper - the upper bound of the range (included)value - the nested SearchStructure to be added
public void put(K lower,
K upper,
boolean lowerInclusive,
boolean upperInclusive,
V value)
If the lower bound is greater than upper bound, the lower and upper bound are automatically switched (including lower- and upper-inclusive parameter).
lower - the lower bound of the range (included)upper - the upper bound of the range (included)lowerInclusive - true if the lower bound should be inclusive,
false if it should be exclusiveupperInclusive - true if the upper bound should be inclusive,
false if it should be exclusivevalue - the nested SearchStructure to be added
public void put(org.faktorips.runtime.internal.tableindex.TwoColumnRange<K> key,
V value)
AbstractMapStructure
put in class AbstractMapStructure<org.faktorips.runtime.internal.tableindex.TwoColumnRange<K extends Comparable<? super K>>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>key - key that maps to the specified valuevalue - value to be associated with the specified key.Map.put(Object, Object),
AbstractMapStructure.merge(AbstractMapStructure)protected TreeMap<org.faktorips.runtime.internal.tableindex.TwoColumnRange<K>,V> getMap()
getMap in class AbstractMapStructure<org.faktorips.runtime.internal.tableindex.TwoColumnRange<K extends Comparable<? super K>>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>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.public void merge(TwoColumnRangeStructure<K,V,R> map)
MergeAndCopyStructureSearchStructure
deletes no content, instead equal values are being merged recursively.
merge in interface MergeAndCopyStructure<TwoColumnRangeStructure<K extends Comparable<? super K>,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>>map - The object that should be merged into this objectpublic TwoColumnRangeStructure<K,V,R> copy()
MergeAndCopyStructureMergeAndCopyStructure.copy().
copy in interface MergeAndCopyStructure<TwoColumnRangeStructure<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 | |||||||||