|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.util.AbstractMap
com.tangosol.run.xml.SimpleElement.AttributeMap
public class SimpleElement.AttributeMap
A Map implementation using a list that can be a read-only map that supports only Strings for keys and XmlValue for values.
As of Coherence 3.2, this is an inlined version of the old ListMap.
Nested Class Summary | |
---|---|
class |
SimpleElement.AttributeMap.Entry An implementation of Entry that supports keeping them in a list. |
protected class |
SimpleElement.AttributeMap.EntrySet A Set implementation to hold Entry objects. |
Constructor Summary | |
---|---|
SimpleElement.AttributeMap() |
Method Summary | |
---|---|
void |
clear() Removes all mappings from this map (optional operation). |
java.lang.Object |
clone() Returns a shallow copy of this AbstractMap instance: the keys and values themselves are not cloned. |
boolean |
containsKey(java.lang.Object key) Returns true if this map contains a mapping for the specified key. |
java.util.Set |
entrySet() Returns a set view of the mappings contained in this map. |
boolean |
equals(java.lang.Object o) Compares the specified object with this map for equality. |
protected SimpleElement.AttributeMap.Entry |
findEntry(java.lang.Object oKey) Find an entry with the specified key. |
java.lang.Object |
get(java.lang.Object key) Returns the value to which this map maps the specified key. |
protected SimpleElement.AttributeMap.Entry |
getFirstEntry() Return the first entry in the list.. |
protected SimpleElement.AttributeMap.Entry |
instantiateEntry(java.lang.Object oKey, java.lang.Object oVal) Instantiate an Entry instance. |
protected java.util.Set |
instantiateEntrySet() Instantiate an Entry Set. |
java.lang.Object |
put(java.lang.Object key, java.lang.Object value) Associates the specified value with the specified key in this map (optional operation). |
void |
readExternal(java.io.DataInput in) Restore the contents of this object by loading the object's state from the passed DataInput object. |
java.lang.Object |
remove(java.lang.Object key) Removes the mapping for this key from this map if present (optional operation). |
int |
size() Returns the number of key-value mappings in this map. |
void |
writeExternal(java.io.DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object. |
Methods inherited from class java.util.AbstractMap |
---|
containsValue, hashCode, isEmpty, keySet, putAll, toString, values |
Constructor Detail |
---|
public SimpleElement.AttributeMap()
Method Detail |
---|
public int size()
java.util.AbstractMap
This implementation returns entrySet().size().
size
in interface java.util.Map
size
in class java.util.AbstractMap
public boolean containsKey(java.lang.Object key)
java.util.AbstractMap
This implementation iterates over entrySet() searching for an entry with the specified key. If such an entry is found, true is returned. If the iteration terminates without finding such an entry, false is returned. Note that this implementation requires linear time in the size of the map; many implementations will override this method.
containsKey
in interface java.util.Map
containsKey
in class java.util.AbstractMap
key
- key whose presence in this map is to be tested.public java.lang.Object get(java.lang.Object key)
java.util.AbstractMap
This implementation iterates over entrySet() searching for an entry with the specified key. If such an entry is found, the entry's value is returned. If the iteration terminates without finding such an entry, null is returned. Note that this implementation requires linear time in the size of the map; many implementations will override this method.
get
in interface java.util.Map
get
in class java.util.AbstractMap
key
- key whose associated value is to be returned.AbstractMap.containsKey(Object)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
java.util.AbstractMap
This implementation always throws an UnsupportedOperationException.
put
in interface java.util.Map
put
in class java.util.AbstractMap
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.public java.lang.Object remove(java.lang.Object key)
java.util.AbstractMap
This implementation iterates over entrySet() searching for an entry with the specified key. If such an entry is found, its value is obtained with its getValue operation, the entry is removed from the Collection (and the backing map) with the iterator's remove operation, and the saved value is returned. If the iteration terminates without finding such an entry, null is returned. Note that this implementation requires linear time in the size of the map; many implementations will override this method.
Note that this implementation throws an UnsupportedOperationException if the entrySet iterator does not support the remove method and this map contains a mapping for the specified key.
remove
in interface java.util.Map
remove
in class java.util.AbstractMap
key
- key whose mapping is to be removed from the map.public void clear()
java.util.AbstractMap
This implementation calls entrySet().clear(). Note that this implementation throws an UnsupportedOperationException if the entrySet does not support the clear operation.
clear
in interface java.util.Map
clear
in class java.util.AbstractMap
public java.util.Set entrySet()
java.util.AbstractMap
entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
public boolean equals(java.lang.Object o)
java.util.AbstractMap
This implementation first checks if the specified object is this map; if so it returns true. Then, it checks if the specified object is a map whose size is identical to the size of this set; if not, it returns false. If so, it iterates over this map's entrySet collection, and checks that the specified map contains each mapping that this map contains. If the specified map fails to contain such a mapping, false is returned. If the iteration completes, true is returned.
equals
in interface java.util.Map
equals
in class java.util.AbstractMap
o
- object to be compared for equality with this map.public java.lang.Object clone()
java.util.AbstractMap
clone
in class java.util.AbstractMap
public void readExternal(java.io.DataInput in) throws java.io.IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException
- if an I/O exception occursjava.io.NotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object tojava.io.IOException
- if an I/O exception occursprotected SimpleElement.AttributeMap.Entry instantiateEntry(java.lang.Object oKey, java.lang.Object oVal)
protected SimpleElement.AttributeMap.Entry findEntry(java.lang.Object oKey)
oKey
- the key to search forprotected SimpleElement.AttributeMap.Entry getFirstEntry()
protected java.util.Set instantiateEntrySet()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |