Package ion.SyncCollections
Class HashDictionary<TKey,TValue>
- java.lang.Object
-
- ion.Meta.Element
-
- ion.SyncCollections.HashDictionary<TKey,TValue>
-
- All Implemented Interfaces:
ICollectionValue<java.util.Map.Entry<TKey,TValue>>,IDictionary<TKey,TValue>,java.lang.Iterable<java.util.Map.Entry<TKey,TValue>>
- Direct Known Subclasses:
ElementHashDictionary
public class HashDictionary<TKey,TValue> extends ion.Meta.Element implements IDictionary<TKey,TValue>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHashDictionary.AddRequestprotected classHashDictionary.ModifyElementRequestprotected classHashDictionary.RemoveRequestprotected classHashDictionary.SetRequest
-
Constructor Summary
Constructors Constructor Description HashDictionary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(TKey key, TValue val)<U extends TKey,W extends TValue>
voidaddAll(java.lang.Iterable<java.util.Map.Entry<U,W>> entries)booleancontains(java.util.Map.Entry<TKey,TValue> item)booleancontains(TKey key)<H extends TKey>
booleancontainsAll(java.lang.Iterable<H> keys)voidcopyTo(java.util.Map.Entry<TKey,TValue>[] arr, int startIndex)intcount()TValueget(TKey key)protected java.util.HashMap<TKey,TValue>getDictionary()ICollectionValue<TKey>getKeys()ICollectionValue<TValue>getValues()protected voidhandleModificationRequests(ion.Meta.IReadOnlyQueueSet<ion.Meta.Request> requests)Handles every request made to modify this Dictionary.java.util.Iterator<java.util.Map.Entry<TKey,TValue>>iterator()voidonDestroy()voidremove(TKey key)voidremoveAll()voidremoveAll(java.lang.Iterable<TKey> keys)voidset(TKey key, TValue value)java.util.Map.Entry<TKey,TValue>[]toArray()-
Methods inherited from class ion.Meta.Element
destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, raise, schedule, wasDestroyed
-
-
-
-
Method Detail
-
onDestroy
public void onDestroy()
- Specified by:
onDestroyin classion.Meta.Element
-
handleModificationRequests
protected void handleModificationRequests(ion.Meta.IReadOnlyQueueSet<ion.Meta.Request> requests)
Handles every request made to modify this Dictionary. Sets have maximum priority. I.E. All elements on setRequests are removed from the add and remove requests list.- Parameters:
requests-
-
addAll
public <U extends TKey,W extends TValue> void addAll(java.lang.Iterable<java.util.Map.Entry<U,W>> entries)
- Specified by:
addAllin interfaceIDictionary<TKey,TValue>
-
remove
public void remove(TKey key)
- Specified by:
removein interfaceIDictionary<TKey,TValue>
-
removeAll
public void removeAll(java.lang.Iterable<TKey> keys)
- Specified by:
removeAllin interfaceIDictionary<TKey,TValue>
-
removeAll
public void removeAll()
- Specified by:
removeAllin interfaceIDictionary<TKey,TValue>
-
contains
public boolean contains(TKey key)
- Specified by:
containsin interfaceIDictionary<TKey,TValue>
-
containsAll
public <H extends TKey> boolean containsAll(java.lang.Iterable<H> keys)
- Specified by:
containsAllin interfaceIDictionary<TKey,TValue>
-
getKeys
public ICollectionValue<TKey> getKeys()
- Specified by:
getKeysin interfaceIDictionary<TKey,TValue>
-
getValues
public ICollectionValue<TValue> getValues()
- Specified by:
getValuesin interfaceIDictionary<TKey,TValue>
-
set
public void set(TKey key, TValue value)
- Specified by:
setin interfaceIDictionary<TKey,TValue>
-
count
public int count()
- Specified by:
countin interfaceICollectionValue<TKey>
-
copyTo
public void copyTo(java.util.Map.Entry<TKey,TValue>[] arr, int startIndex)
- Specified by:
copyToin interfaceICollectionValue<TKey>
-
toArray
public java.util.Map.Entry<TKey,TValue>[] toArray()
- Specified by:
toArrayin interfaceICollectionValue<TKey>
-
iterator
public java.util.Iterator<java.util.Map.Entry<TKey,TValue>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<TKey>
-
-