Class QueryResultMap<KeyType,ValueType>
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore<KeyType,ValueType>
-
- org.eclipse.viatra.query.runtime.base.api.QueryResultMap<KeyType,ValueType>
-
- All Implemented Interfaces:
java.util.Map<KeyType,ValueType>
public abstract class QueryResultMap<KeyType,ValueType> extends QueryResultAssociativeStore<KeyType,ValueType> implements java.util.Map<KeyType,ValueType>
-
-
Field Summary
-
Fields inherited from class org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore
NOT_ALLOW_MODIFICATIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
QueryResultMap(org.apache.log4j.Logger logger)
Constructor only visible to subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<KeyType,ValueType>>
entrySet()
ValueType
get(java.lang.Object key)
protected java.util.Map<KeyType,ValueType>
getCache()
protected java.util.Collection<java.util.Map.Entry<KeyType,ValueType>>
getCacheEntries()
Returns the entries in the cache as a collection.protected boolean
internalCacheContainsEntry(KeyType key, ValueType value)
protected boolean
internalCachePut(KeyType key, ValueType value)
protected boolean
internalCacheRemove(KeyType key, ValueType value)
protected int
internalCacheSize()
boolean
isEmpty()
java.util.Set<KeyType>
keySet()
ValueType
put(KeyType key, ValueType value)
void
putAll(java.util.Map<? extends KeyType,? extends ValueType> map)
ValueType
remove(java.lang.Object key)
protected void
setCache(java.util.Map<KeyType,ValueType> cache)
int
size()
java.util.Collection<ValueType>
values()
-
Methods inherited from class org.eclipse.viatra.query.runtime.base.api.QueryResultAssociativeStore
addCallbackOnQueryResultUpdate, checkModificationThroughQueryResultSetter, getListeners, getLogger, getSetter, internalClear, internalPut, internalRemove, modifyThroughQueryResultSetter, notifyListeners, removeCallbackOnQueryResultUpdate, setListeners, setLogger, setQueryResultSetter, setSetter
-
-
-
-
Method Detail
-
getCacheEntries
protected java.util.Collection<java.util.Map.Entry<KeyType,ValueType>> getCacheEntries()
Description copied from class:QueryResultAssociativeStore
Returns the entries in the cache as a collection.- Specified by:
getCacheEntries
in classQueryResultAssociativeStore<KeyType,ValueType>
- Returns:
- the entries
-
internalCachePut
protected boolean internalCachePut(KeyType key, ValueType value)
- Specified by:
internalCachePut
in classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheRemove
protected boolean internalCacheRemove(KeyType key, ValueType value)
- Specified by:
internalCacheRemove
in classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheSize
protected int internalCacheSize()
- Specified by:
internalCacheSize
in classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheContainsEntry
protected boolean internalCacheContainsEntry(KeyType key, ValueType value)
- Specified by:
internalCacheContainsEntry
in classQueryResultAssociativeStore<KeyType,ValueType>
-
setCache
protected void setCache(java.util.Map<KeyType,ValueType> cache)
- Parameters:
cache
- the cache to set
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
entrySet
public java.util.Set<java.util.Map.Entry<KeyType,ValueType>> entrySet()
The returned set is immutable.
-
get
public ValueType get(java.lang.Object key)
-
isEmpty
public boolean isEmpty()
-
keySet
public java.util.Set<KeyType> keySet()
The returned set is immutable.
-
put
public ValueType put(KeyType key, ValueType value)
Throws
UnsupportedOperationException
if there is noIQueryResultSetter
-
putAll
public void putAll(java.util.Map<? extends KeyType,? extends ValueType> map)
Throws
UnsupportedOperationException
if there is noIQueryResultSetter
-
remove
public ValueType remove(java.lang.Object key)
Throws
UnsupportedOperationException
if there is noIQueryResultSetter
-
-