Package com.sun.javatest.util
Class PrefixMap<V>
- java.lang.Object
-
- com.sun.javatest.util.PrefixMap<V>
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,V>
public class PrefixMap<V> extends java.lang.Object implements java.util.Map<java.lang.String,V>
A map whose entries are stored in a parent map by prefixing the key names with a specific string.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<java.lang.String,V>>
entrySet()
V
get(java.lang.Object key)
java.lang.String
getPrefix()
Get the prefix that this map is applying.int
hashCode()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
V
put(java.lang.String key, V value)
void
putAll(java.util.Map<? extends java.lang.String,? extends V> t)
V
remove(java.lang.Object key)
int
size()
java.util.Collection<V>
values()
-
-
-
Constructor Detail
-
PrefixMap
public PrefixMap(java.util.Map<java.lang.String,V> map, java.lang.String prefix)
Create a map whose entries are stored in a parent map by prefixing the key names with a specific string.- Parameters:
map
- the parent mapprefix
- the prefix with which to prefix the entries in the parent map
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.String,V>
-
getPrefix
public java.lang.String getPrefix()
Get the prefix that this map is applying. This is the value that was supplied to the constructor. This class reserves the right to return a String which is not reference equivalent to the given string.- Returns:
- The prefix string, which may be a zero length string.
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,V>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,V>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,V>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,V>
-
get
public V get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,V>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,V>
- Overrides:
hashCode
in classjava.lang.Object
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,V>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,V>
-
put
public V put(java.lang.String key, V value)
- Specified by:
put
in interfacejava.util.Map<java.lang.String,V>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends V> t)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,V>
-
remove
public V remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,V>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.String,V>
-
-