public class KeyStructure<K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> extends AbstractMapStructure<K,V,R> implements MergeAndCopyStructure<KeyStructure<K,V,R>>
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.AbstractMapStructure| Modifier and Type | Method and Description |
|---|---|
KeyStructure<K,V,R> |
copy()
This method copies the object which calls it.
|
static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> |
create()
Creates a new empty
KeyStructure. |
static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> |
createWith(K key,
V value)
Creates a new
KeyStructure and put the given key value pair. |
SearchStructure<R> |
get(Object key)
Returns the nested
SearchStructure for the given key. |
void |
merge(KeyStructure<K,V,R> map)
Merging adds the contents of the otherMergable to this object.
|
emptyResult, fillCopy, get, getMap, getValidResult, merge, putgetUnique, getUniquepublic static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> KeyStructure<K,V,R> create()
KeyStructure.public static <K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R> KeyStructure<K,V,R> createWith(K key, V value)
KeyStructure and put 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 SearchStructureSearchStructure or an EmptySearchStructure if the key does
not exist.public void merge(KeyStructure<K,V,R> map)
MergeAndCopyStructureSearchStructure
deletes no content, instead equal values are being merged recursively.merge in interface MergeAndCopyStructure<KeyStructure<K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>>map - The object that should be merged into this objectpublic KeyStructure<K,V,R> copy()
MergeAndCopyStructureMergeAndCopyStructure.copy().copy in interface MergeAndCopyStructure<KeyStructure<K,V extends SearchStructure<R> & MergeAndCopyStructure<V>,R>>Copyright © 2016. All rights reserved.