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 voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<java.lang.String,V>>entrySet()Vget(java.lang.Object key)java.lang.StringgetPrefix()Get the prefix that this map is applying.inthashCode()booleanisEmpty()java.util.Set<java.lang.String>keySet()Vput(java.lang.String key, V value)voidputAll(java.util.Map<? extends java.lang.String,? extends V> t)Vremove(java.lang.Object key)intsize()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:
clearin 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:
containsKeyin interfacejava.util.Map<java.lang.String,V>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map<java.lang.String,V>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,V>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<java.lang.String,V>
-
get
public V get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map<java.lang.String,V>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Map<java.lang.String,V>- Overrides:
hashCodein classjava.lang.Object
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<java.lang.String,V>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySetin interfacejava.util.Map<java.lang.String,V>
-
put
public V put(java.lang.String key, V value)
- Specified by:
putin interfacejava.util.Map<java.lang.String,V>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends V> t)
- Specified by:
putAllin interfacejava.util.Map<java.lang.String,V>
-
remove
public V remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<java.lang.String,V>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<java.lang.String,V>
-
-