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 ofAbstractMapStructuremapping keys to nestedSearchStructuresmuch like a map. This structure is useful for values that can be identified by their key. The generic types are described inAbstractMapStructure.- See Also:
AbstractMapStructure
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyStructure<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.SearchStructure<R>get(java.lang.Object key)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, put
-
Methods inherited from class org.faktorips.runtime.internal.tableindex.SearchStructure
getUnique, getUnique
-
-
-
-
Method Detail
-
create
public static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> KeyStructure<K,V,R> create()
Creates a new emptyKeyStructure.
-
createWith
public 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.
-
get
public SearchStructure<R> get(java.lang.Object key)
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
public void merge(KeyStructure<K,V,R> map)
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
public KeyStructure<K,V,R> 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
-
-