|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.RestrictedCollections.RestrictedMap
public static class RestrictedCollections.RestrictedMap
A restricted Map that requires its keys and values to be of specified classes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry |
Field Summary | |
---|---|
protected Class |
m_clzKey
The class of key stored in the Map. |
protected Class |
m_clzVal
The class of value stored in the Map. |
protected Map |
m_map
The underlying Map. |
protected Set |
m_set
The Entry Set. |
Constructor Summary | |
---|---|
RestrictedCollections.RestrictedMap(Map map,
Class clzKey,
Class clzVal)
Constructor. |
Method Summary | |
---|---|
protected void |
checkKey(Object o)
Check the passed object to verify that it passes the "key" restriction of this Map. |
protected void |
checkValue(Object o)
Check the passed object to verify that it passes the "value" restriction of this Map. |
void |
clear()
Removes all mappings from this map. |
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value. |
Set |
entrySet()
Returns a set view of the mappings contained in this map. |
boolean |
equals(Object o)
Compares the specified object with this map for equality. |
Object |
get(Object key)
Returns the value to which this map maps the specified key. |
int |
hashCode()
Returns the hash code value for this map. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
Set |
keySet()
Returns a set view of the keys contained in this map. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map. |
void |
putAll(Map map)
Copies all of the mappings from the specified map to this map. |
Object |
remove(Object key)
Removes the mapping for this key from this map if present. |
int |
size()
Returns the number of key-value mappings in this map. |
String |
toString()
Return a String description for this Map. |
Collection |
values()
Returns a collection view of the values contained in this map. |
Field Detail |
---|
protected Map m_map
protected Class m_clzKey
protected Class m_clzVal
protected Set m_set
Constructor Detail |
---|
public RestrictedCollections.RestrictedMap(Map map, Class clzKey, Class clzVal)
map
- the underlying MapclzKey
- the class of keys that may be stored in the MapclzVal
- the class of values that may be stored in the MapMethod Detail |
---|
public int size()
size
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
public boolean containsKey(Object key)
containsKey
in interface Map
key
- key whose presence in this map is to be tested
public boolean containsValue(Object value)
containsValue
in interface Map
value
- value whose presence in this map is to be tested
public Object get(Object key)
get
in interface Map
key
- key whose associated value is to be returned
public Object put(Object key, Object value)
put
in interface Map
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.public Object remove(Object key)
remove
in interface Map
key
- key whose mapping is to be removed from the map
public void putAll(Map map)
putAll
in interface Map
map
- Mappings to be stored in this map
ClassCastException
- if the class of a key or value in the
specified map prevents it from being stored in this mappublic void clear()
clear
in interface Map
public Set keySet()
keySet
in interface Map
public Collection values()
values
in interface Map
public Set entrySet()
entrySet
in interface Map
public boolean equals(Object o)
equals
in interface Map
o
- object to be compared for equality with this map
public int hashCode()
hashCode
in interface Map
public String toString()
protected void checkKey(Object o)
o
- the Object to check
ClassCastException
- if the class of the passed Object
prevents it from being used as a key in this Mapprotected void checkValue(Object o)
o
- the Object to check
ClassCastException
- if the class of the passed Object
prevents it from being used as a value in this Map
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |