public class OverlayMap extends AbstractMap
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.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
OverlayMap(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object key) |
Set |
entrySet() |
Object |
get(Object key) |
Map |
getOverlayMap()
Return the object containing the overlay mappings.
|
Map |
getParentMap()
Return the object containing the fallback mappings.
|
Set |
keySet() |
Object |
put(Object key,
Object value) |
public OverlayMap(Map parent, Map overlay)
parent
- the default fall-through Mapoverlay
- the overriding Mappublic OverlayMap(Map parent)
parent
- the default fall-through Mappublic Map getParentMap()
public Map getOverlayMap()
public Object get(Object key)
get
in interface Map
get
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
public Set keySet()
keySet
in interface Map
keySet
in class AbstractMap
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class AbstractMap
Copyright © 2014 BioJava. All rights reserved.