|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.core.common.util.BaseArrayMap
A protected implementation of a simple storing mechanism
for key-value pairs. For few pairs this will be an array
of alternating key-value pairs. As it grows larger it is
scaled up to a HashMap.
Subclasses may overwrite methods to enable public access.
| Constructor Summary | |
protected |
BaseArrayMap()
Creates a new BaseArrayMap. |
| Method Summary | |
protected void |
clear()
Removes all the mappings. |
protected boolean |
containsKey(java.lang.Object key)
Returns true if we have a value for the key. |
protected boolean |
containsValue(java.lang.Object value)
Returns true if there map one or more keys
to the specified value. |
protected BaseArrayMap |
copyTo(BaseArrayMap arraymap)
Copies the contents to the given BaseArrayMap. |
java.lang.String |
elementsToString(java.lang.String key_value_separator,
java.lang.String pair_separator)
Returns a string representation of the key-value pairs. |
protected static boolean |
eq(java.lang.Object o1,
java.lang.Object o2)
|
boolean |
equals(java.lang.Object obj)
|
protected java.lang.Object |
get(java.lang.Object key)
Gets the value for key |
protected java.lang.Object[] |
getKeys(java.lang.Object[] keys)
Returns the keys of the table, or null if there
are currently no bindings. |
int |
hashCode()
|
protected boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
protected java.util.Iterator |
iterateKeys()
Returns an iterator of the keys in this BaseArrayMap. |
protected java.util.Iterator |
iterateMapEntries()
Returns an iterator of the Map.Entry in this BaseArrayMap.
|
protected java.util.Iterator |
iterateValues()
Returns an iterator of the values in this BaseArrayMap. |
protected java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Put the key-value pair into storage |
void |
putAll(java.util.Map t)
Copies all of the mappings from the specified map to this map. |
protected java.lang.Object |
remove(java.lang.Object key)
Removes the key and its value Returns the value for the pair removed |
protected int |
size()
Returns the number of pairs in storage |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected BaseArrayMap()
BaseArrayMap.
| Method Detail |
protected void clear()
protected boolean containsKey(java.lang.Object key)
true if we have a value for the key.
true if we have a value for the key.protected boolean containsValue(java.lang.Object value)
true if there map one or more keys
to the specified value.
true if maps one or more keys to the
specified value.protected BaseArrayMap copyTo(BaseArrayMap arraymap)
BaseArrayMap.
arraymap - the BaseArrayMap to copy toprotected java.lang.Object get(java.lang.Object key)
key - the key object to look for
protected java.lang.Object[] getKeys(java.lang.Object[] keys)
null if there
are currently no bindings.
keys - array of keys
protected java.util.Iterator iterateKeys()
BaseArrayMap. The general
contract for the iterateKeys method is that an Iterator
object is returned that will generate all the keys for which this
BaseArrayMap contains entries.
BaseArrayMap.protected java.util.Iterator iterateValues()
BaseArrayMap. The general
contract for the iterateValues method is that an Iterator
object is returned that will generate all the values for which this
BaseArrayMap contains entries.
BaseArrayMap.protected java.util.Iterator iterateMapEntries()
Map.Entry in this BaseArrayMap.
Because BaseArrayMap is not based upon AbstractMap
to avoid higher space consumption, this iterator has to create every
Map.Entry to enable Map compatibility. If the BaseArrayMap
is grown to a real map, this returns the entries of the real map.
Avoid calling this method in preformance-relevant scenarios!
Map.Entry in this BaseArrayMap.
protected java.lang.Object put(java.lang.Object key,
java.lang.Object value)
key - the key objectvalue - the value object
null
if there was no mapping for key. A null return can also
indicate that the map previously associated null with the
specified key.protected java.lang.Object remove(java.lang.Object key)
key - the key object
protected int size()
protected boolean isEmpty()
true if this map contains no key-value mappings.
This implementation returns size()==0.
public void putAll(java.util.Map t)
t - the map to put mappings frompublic int hashCode()
public boolean equals(java.lang.Object obj)
public java.lang.String toString()
public java.lang.String elementsToString(java.lang.String key_value_separator,
java.lang.String pair_separator)
key_value_separator - the separator string to separate key from valuepair_separator - a separator string to separate key-value pairs
protected static final boolean eq(java.lang.Object o1,
java.lang.Object o2)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||