Package org.biojava.utils
Class OverlayMap
java.lang.Object
java.util.AbstractMap
org.biojava.utils.OverlayMap
- All Implemented Interfaces:
Map
Overlap one map onto another. This allows you to have a map with local values and default values. The local and default values are provided by a child and parent map.
- Author:
- Thomas Down, Matthew Pocock
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionOverlayMap(Map parent) Build a new map with default key-value pairs.OverlayMap(Map parent, Map overlay) Build a new map with default key-value pairs. -
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
OverlayMap
Build a new map with default key-value pairs.- Parameters:
parent- the default fall-through Mapoverlay- the overriding Map
-
OverlayMap
Build a new map with default key-value pairs.- Parameters:
parent- the default fall-through Map
-
-
Method Details
-
getParentMap
Return the object containing the fallback mappings. This is the actual parent map, not a copy.- Returns:
- the parent map
-
getOverlayMap
Return the object containing the overlay mappings. This is the actual child map, not a copy.- Returns:
- the child map
-
get
- Specified by:
getin interfaceMap- Overrides:
getin classAbstractMap
-
entrySet
- Specified by:
entrySetin interfaceMap- Specified by:
entrySetin classAbstractMap
-
keySet
- Specified by:
keySetin interfaceMap- Overrides:
keySetin classAbstractMap
-
containsKey
- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classAbstractMap
-
put
- Specified by:
putin interfaceMap- Overrides:
putin classAbstractMap
-