Class KeyStructure<K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>
java.lang.Object
org.faktorips.runtime.internal.tableindex.SearchStructure<R>
org.faktorips.runtime.internal.tableindex.AbstractMapStructure<K,V,R>
org.faktorips.runtime.internal.tableindex.KeyStructure<K,V,R>
- All Implemented Interfaces:
MergeAndCopyStructure<KeyStructure<K,V, R>>
public class KeyStructure<K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>
extends AbstractMapStructure<K,V,R>
implements MergeAndCopyStructure<KeyStructure<K,V,R>>
An implementation of
AbstractMapStructure mapping keys to nested SearchStructures much like a map. This structure is useful for values that can be identified by
their key. The generic types are described in AbstractMapStructure.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionKeyStructure<K,V, R> copy()This method copies the object which calls it.static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>, R>
KeyStructure<K,V, R> create()Creates a new emptyKeyStructure.static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>, R>
KeyStructure<K,V, R> createWith(K key, V value) Creates a newKeyStructureand put the given key value pair.Returns the nestedSearchStructurefor the given key.voidmerge(KeyStructure<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, getMap, getValidResult, merge, putMethods inherited from class org.faktorips.runtime.internal.tableindex.SearchStructure
getUnique, getUnique
-
Method Details
-
create
public static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>, KeyStructure<K,R> V, create()R> Creates a new emptyKeyStructure. -
createWith
public static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>, KeyStructure<K,R> V, createWithR> (K key, V value) Creates a newKeyStructureand put the given key value pair. -
get
Description copied from class:SearchStructureReturns the nestedSearchStructurefor the given key. This method never returnsnull. If no value exists for a given key anEmptySearchStructureis returned as a fall-back.- Specified by:
getin classSearchStructure<R>- Parameters:
key- The key for the requested nestedSearchStructure- Returns:
- The nested
SearchStructureor anEmptySearchStructureif the key does not exist.
-
merge
Description copied from interface:MergeAndCopyStructureMerging adds the contents of the otherMergable to this object. This object then contains the combined content. The other object remains unchanged.Merging aSearchStructuredeletes no content, instead equal values are being merged recursively.- Specified by:
mergein interfaceMergeAndCopyStructure<K>- Parameters:
map- The object that should be merged into this object
-
copy
Description copied from interface:MergeAndCopyStructureThis method copies the object which calls it. The newly created object has the same properties like the object callingMergeAndCopyStructure.copy().- Specified by:
copyin interfaceMergeAndCopyStructure<K>- Returns:
- T that is a copy of the calling object
-