|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.commons.util.map.AbstractIMap<K,V>
org.millscript.commons.util.map.AbstractUMap<K,V>
org.millscript.commons.util.map.AbstractEMap<K,V>
org.millscript.commons.util.map.EArrayMap<K,V>
public class EArrayMap<K,V>
This class provides a mutable Map implementation which is
backed by an Object array containing alternate name-value objects.
| Nested Class Summary | |
|---|---|
static class |
EArrayMap.ArrayMapMapIterator<K,V>
This class implements a map iterator which iterates over an array containing alternating key-value objects, sharing the backing store with it's enclosing mutable map. |
| Constructor Summary | |
|---|---|
EArrayMap()
Constructs a new, emtpy mutable array map. |
|
EArrayMap(java.lang.Object[] objects)
Constructs a new mutable array map with a copy of the specified backing array containing alternate name-value objects. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
boolean |
contains(K key,
V value)
Returns true if this map contains a mapping from the
specified key to the specified value. |
boolean |
containsKey(K key)
Returns true if this map contains an entry for the
specified key. |
boolean |
containsValue(V value)
Returns true if this map contains an entry with the
specified value. |
V |
get(K key)
Returns the value associated with the specified key, or the default value if no such mapping exists. |
void |
insert(K key,
V value)
Inserts the specified key-value pair into this map, associating the key with the value. |
void |
insertAll(IMap<? extends K,? extends V> map)
Inserts all the mappings from the specified map into this map. |
MapIterator<K,V> |
iterator(boolean share)
Returns an iterator over the mappings in this map. |
void |
remove(K key,
V value)
Removes the specified key-value pair from this map. |
void |
removeAll()
Removes all the mappings from this map. |
void |
removeKey(K key)
Removes the mapping for the specified key. |
void |
removeValue(V value)
Removes any mappings from this map which map to the specified value. |
protected IList<K> |
sharedKeyList()
|
protected IList<Maplet<K,V>> |
sharedMapletList()
|
protected IList<V> |
sharedValueList()
|
int |
size()
Returns the number of mappings defined in this map. |
void |
update(K key,
V value)
Updates the mapping for the specified key with the specified value, changing the previous value. |
| Methods inherited from class org.millscript.commons.util.map.AbstractEMap |
|---|
insert, remove, removeAll |
| Methods inherited from class org.millscript.commons.util.map.AbstractUMap |
|---|
update, updateAll |
| Methods inherited from class org.millscript.commons.util.map.AbstractIMap |
|---|
contains, containsAll, decorate, equals, getDefault, hashCode, isEmtpy, keyList, mapletList, setDefault, toString, valueList |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.millscript.commons.util.UMap |
|---|
update, updateAll |
| Methods inherited from interface org.millscript.commons.util.IMap |
|---|
contains, containsAll, equals, getDefault, hashCode, isEmtpy, keyList, mapletList, setDefault, valueList |
| Constructor Detail |
|---|
public EArrayMap()
public EArrayMap(java.lang.Object[] objects)
objects - the backing array of alternate name-value objects to
copy| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()
public boolean contains(K key,
V value)
IMaptrue if this map contains a mapping from the
specified key to the specified value.
contains in interface IMap<K,V>key - the key whose presence to testvalue - the value which must match that stored against the
specified key
true if this map contains a mapping for the
specified key-value combinationIMap.contains(java.lang.Object, java.lang.Object)public boolean containsKey(K key)
IMaptrue if this map contains an entry for the
specified key.
containsKey in interface IMap<K,V>key - the key whose presence to test
true if this map contains a mapping for the
specified keyIMap.containsKey(java.lang.Object)public boolean containsValue(V value)
IMaptrue if this map contains an entry with the
specified value.
containsValue in interface IMap<K,V>value - the value whose presence to test
true if this map contains a mapping with the
specified valueIMap.containsValue(java.lang.Object)public V get(K key)
IMap
get in interface IMap<K,V>key - the key whose associated value to return
IMap.get(java.lang.Object)
public void insert(K key,
V value)
EMap
insert in interface EMap<K,V>key - the key to associate the value withvalue - the value to associate the key withEMap.insert(java.lang.Object, java.lang.Object)public void insertAll(IMap<? extends K,? extends V> map)
EMap
insertAll in interface EMap<K,V>insertAll in class AbstractEMap<K,V>map - the map to copy all mappings fromEMap.insertAll(org.millscript.commons.util.IMap)public MapIterator<K,V> iterator(boolean share)
IMap
iterator in interface IMap<K,V>share - if true this instances backing store should be
shared with the returned list, otherwise any backing store will be copied.
IMap.iterator(boolean)
public void remove(K key,
V value)
EMap
remove in interface EMap<K,V>key - the key to remove from this map if it is associated with
the specified valuevalue - the value to remove from this map if it is associated with
the specified keyEMap.remove(java.lang.Object, java.lang.Object)public void removeAll()
EMap
removeAll in interface EMap<K,V>EMap.removeAll()public void removeKey(K key)
EMap
removeKey in interface EMap<K,V>key - the key to remove from this mapEMap.removeKey(java.lang.Object)public void removeValue(V value)
EMap
removeValue in interface EMap<K,V>value - the value to remove from this mapEMap.removeValue(java.lang.Object)protected IList<K> sharedKeyList()
sharedKeyList in class AbstractIMap<K,V>AbstractIMap.sharedKeyList()protected IList<Maplet<K,V>> sharedMapletList()
sharedMapletList in class AbstractIMap<K,V>AbstractIMap.sharedMapletList()protected IList<V> sharedValueList()
sharedValueList in class AbstractIMap<K,V>AbstractIMap.sharedValueList()public int size()
IMap
size in interface IMap<K,V>IMap.size()
public void update(K key,
V value)
UMap
update in interface UMap<K,V>key - the key to associate the value withvalue - the value to associate the key withUMap.update(java.lang.Object, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||