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 protectedQueryResultMap(org.apache.log4j.Logger logger)Constructor only visible to subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<KeyType,ValueType>>entrySet()ValueTypeget(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 booleaninternalCacheContainsEntry(KeyType key, ValueType value)protected booleaninternalCachePut(KeyType key, ValueType value)protected booleaninternalCacheRemove(KeyType key, ValueType value)protected intinternalCacheSize()booleanisEmpty()java.util.Set<KeyType>keySet()ValueTypeput(KeyType key, ValueType value)voidputAll(java.util.Map<? extends KeyType,? extends ValueType> map)ValueTyperemove(java.lang.Object key)protected voidsetCache(java.util.Map<KeyType,ValueType> cache)intsize()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:QueryResultAssociativeStoreReturns the entries in the cache as a collection.- Specified by:
getCacheEntriesin classQueryResultAssociativeStore<KeyType,ValueType>- Returns:
- the entries
-
internalCachePut
protected boolean internalCachePut(KeyType key, ValueType value)
- Specified by:
internalCachePutin classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheRemove
protected boolean internalCacheRemove(KeyType key, ValueType value)
- Specified by:
internalCacheRemovein classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheSize
protected int internalCacheSize()
- Specified by:
internalCacheSizein classQueryResultAssociativeStore<KeyType,ValueType>
-
internalCacheContainsEntry
protected boolean internalCacheContainsEntry(KeyType key, ValueType value)
- Specified by:
internalCacheContainsEntryin 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
UnsupportedOperationExceptionif there is noIQueryResultSetter
-
putAll
public void putAll(java.util.Map<? extends KeyType,? extends ValueType> map)
Throws
UnsupportedOperationExceptionif there is noIQueryResultSetter
-
remove
public ValueType remove(java.lang.Object key)
Throws
UnsupportedOperationExceptionif there is noIQueryResultSetter
-
-