public abstract class TopiaEntityMap<K extends TopiaEntityEnum,V extends TopiaEntity> extends HashMap<K,List<? extends V>>
TopiaEntity
associated to a TopiaEntityEnum
.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
TopiaEntityMap() |
TopiaEntityMap(int initialCapacity) |
TopiaEntityMap(int initialCapacity,
float loadFactor) |
TopiaEntityMap(Map<? extends K,? extends List<? extends V>> m) |
Modifier and Type | Method and Description |
---|---|
<T extends V> |
addEntity(T entity)
Adds the given entity to the dictonary (even if it does already exists).
|
<T extends V> |
addUniqueEntity(T entity)
Adds the given entity to the dictonary only if it does not exists.
|
<T extends V> |
get(Class<T> type) |
protected <T extends V> |
getList(T entity) |
protected abstract K |
getType(Class<?> e)
Obtains from a entity his key.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public TopiaEntityMap(int initialCapacity, float loadFactor)
public TopiaEntityMap(int initialCapacity)
public TopiaEntityMap()
protected abstract K getType(Class<?> e)
e
- the entity on which to find the key.public <T extends V> boolean addUniqueEntity(T entity)
true
if entity was added, false
otherwise.T
- the type of entity to addentity
- the entity to addtrue
if entity was added, false
otherwise.public <T extends V> void addEntity(T entity)
T
- the type of entity to addentity
- the entity to addCopyright © 2004–2022 Code Lutin. All rights reserved.