Class DefaultMergeMap<K,T extends AbstractAsConfiguration,R extends AbstractAsConfiguration>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,AsConfigurationHolder<T,R>>
de.hybris.platform.adaptivesearch.strategies.impl.DefaultMergeMap<K,T,R>
- All Implemented Interfaces:
MergeMap<K,,AsConfigurationHolder<T, R>> Serializable,Cloneable,Map<K,AsConfigurationHolder<T, R>>
public class DefaultMergeMap<K,T extends AbstractAsConfiguration,R extends AbstractAsConfiguration>
extends HashMap<K,AsConfigurationHolder<T,R>>
implements MergeMap<K,AsConfigurationHolder<T,R>>
Default implementation of
MergeMap.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanintReturns the highest rank of the values in the map.intReturns the lowest rank of the values in the map.inthashCode()voidmergeAfter(MergeMap<K, AsConfigurationHolder<T, R>> source, MergeFunction<K, AsConfigurationHolder<T, R>> mergeFunction) Merges both maps, all entries from source map are added to this map.mergeAfter(K key, AsConfigurationHolder<T, R> value) Associates the given value with the given key in this map.voidmergeBefore(MergeMap<K, AsConfigurationHolder<T, R>> source, MergeFunction<K, AsConfigurationHolder<T, R>> mergeFunction) Merges both maps, all entries from source map are added to this map.mergeBefore(K key, AsConfigurationHolder<T, R> value) Associates the given value with the given key in this map.Returns an orderedListof the values contained in this map.put(K key, AsConfigurationHolder<T, R> value) Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
RANK_COMPARATOR
-
-
Constructor Details
-
DefaultMergeMap
public DefaultMergeMap() -
DefaultMergeMap
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceMap<K,T extends AbstractAsConfiguration> - Overrides:
clearin classHashMap<K,AsConfigurationHolder<T extends AbstractAsConfiguration, R extends AbstractAsConfiguration>>
-
put
- Specified by:
putin interfaceMap<K,T extends AbstractAsConfiguration> - Overrides:
putin classHashMap<K,AsConfigurationHolder<T extends AbstractAsConfiguration, R extends AbstractAsConfiguration>>
-
getHighestRank
public int getHighestRank()Description copied from interface:MergeMapReturns the highest rank of the values in the map.- Specified by:
getHighestRankin interfaceMergeMap<K,T extends AbstractAsConfiguration> - Returns:
- the highest rank of the values in the map
-
getLowestRank
public int getLowestRank()Description copied from interface:MergeMapReturns the lowest rank of the values in the map.- Specified by:
getLowestRankin interfaceMergeMap<K,T extends AbstractAsConfiguration> - Returns:
- the lowest rank of the values in the map
-
mergeBefore
Description copied from interface:MergeMapAssociates the given value with the given key in this map. The new value is added with an higher rank.- Specified by:
mergeBeforein interfaceMergeMap<K,T extends AbstractAsConfiguration> - Parameters:
key- - the keyvalue- - the value- Returns:
- the previous value, or null if there was no mapping for the key
-
mergeBefore
public void mergeBefore(MergeMap<K, AsConfigurationHolder<T, R>> source, MergeFunction<K, AsConfigurationHolder<T, R>> mergeFunction) Description copied from interface:MergeMapMerges both maps, all entries from source map are added to this map. The new values are added with an higher rank, the rank hierarchy from the source map is preserved. If the merge function returns null, the mapping is removed.- Specified by:
mergeBeforein interfaceMergeMap<K,T extends AbstractAsConfiguration> - Parameters:
source- - the source mapmergeFunction- - the merge function
-
mergeAfter
Description copied from interface:MergeMapAssociates the given value with the given key in this map. The new value is added with a lower rank.- Specified by:
mergeAfterin interfaceMergeMap<K,T extends AbstractAsConfiguration> - Parameters:
key- - the keyvalue- - the value- Returns:
- the previous value, or null if there was no mapping for the key
-
mergeAfter
public void mergeAfter(MergeMap<K, AsConfigurationHolder<T, R>> source, MergeFunction<K, AsConfigurationHolder<T, R>> mergeFunction) Description copied from interface:MergeMapMerges both maps, all entries from source map are added to this map. The new values are added with a lower rank, the rank hierarchy from the source map is preserved. If the merge function returns null, the mapping is removed.- Specified by:
mergeAfterin interfaceMergeMap<K,T extends AbstractAsConfiguration> - Parameters:
source- - the source mapmergeFunction- - the merge function
-
orderedValues
Description copied from interface:MergeMapReturns an orderedListof the values contained in this map.- Specified by:
orderedValuesin interfaceMergeMap<K,T extends AbstractAsConfiguration> - Returns:
- an ordered
Listof the values contained in this map
-
equals
- Specified by:
equalsin interfaceMap<K,T extends AbstractAsConfiguration> - Overrides:
equalsin classAbstractMap<K,AsConfigurationHolder<T extends AbstractAsConfiguration, R extends AbstractAsConfiguration>>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceMap<K,T extends AbstractAsConfiguration> - Overrides:
hashCodein classAbstractMap<K,AsConfigurationHolder<T extends AbstractAsConfiguration, R extends AbstractAsConfiguration>>
-