KeyType
- the type of the keys stored in the multimapValueType
- the type of the values stored in the multimappublic abstract class QueryResultMultimap<KeyType,ValueType> extends QueryResultAssociativeStore<KeyType,ValueType> implements com.google.common.collect.Multimap<KeyType,ValueType>
Multimap
interface to represent query results. A query result multimap takes a model query,
with a specified key (input/source) parameter and a value (output/target) parameter.
Apart from the standard multimap behavior, it is possible to register listeners that are notified when the contents of the multimap change.
Subclasses of the query result multimap can attach to any query evaluation engine and shoug
NOT_ALLOW_MODIFICATIONS
Modifier | Constructor and Description |
---|---|
protected |
QueryResultMultimap(org.apache.log4j.Logger logger)
Constructor only visible to subclasses.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<KeyType,java.util.Collection<ValueType>> |
asMap() |
void |
clear() |
boolean |
containsEntry(java.lang.Object key,
java.lang.Object value) |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Collection<java.util.Map.Entry<KeyType,ValueType>> |
entries() |
java.util.Collection<ValueType> |
get(KeyType key) |
protected com.google.common.collect.Multimap<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() |
com.google.common.collect.Multiset<KeyType> |
keys() |
java.util.Set<KeyType> |
keySet() |
boolean |
put(KeyType key,
ValueType value) |
boolean |
putAll(KeyType key,
java.lang.Iterable<? extends ValueType> values) |
boolean |
putAll(com.google.common.collect.Multimap<? extends KeyType,? extends ValueType> multimap) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
java.util.Collection<ValueType> |
removeAll(java.lang.Object key) |
java.util.Collection<ValueType> |
replaceValues(KeyType key,
java.lang.Iterable<? extends ValueType> values) |
protected void |
setCache(com.google.common.collect.Multimap<KeyType,ValueType> cache) |
int |
size() |
java.util.Collection<ValueType> |
values() |
addCallbackOnQueryResultUpdate, checkModificationThroughQueryResultSetter, getListeners, getLogger, getSetter, internalClear, internalPut, internalRemove, modifyThroughQueryResultSetter, notifyListeners, removeCallbackOnQueryResultUpdate, setListeners, setLogger, setQueryResultSetter, setSetter
protected QueryResultMultimap(org.apache.log4j.Logger logger)
logger
- a logger that can be used for error reportingprotected java.util.Collection<java.util.Map.Entry<KeyType,ValueType>> getCacheEntries()
QueryResultAssociativeStore
getCacheEntries
in class QueryResultAssociativeStore<KeyType,ValueType>
protected boolean internalCachePut(KeyType key, ValueType value)
internalCachePut
in class QueryResultAssociativeStore<KeyType,ValueType>
protected boolean internalCacheRemove(KeyType key, ValueType value)
internalCacheRemove
in class QueryResultAssociativeStore<KeyType,ValueType>
protected boolean internalCacheContainsEntry(KeyType key, ValueType value)
internalCacheContainsEntry
in class QueryResultAssociativeStore<KeyType,ValueType>
protected int internalCacheSize()
internalCacheSize
in class QueryResultAssociativeStore<KeyType,ValueType>
protected com.google.common.collect.Multimap<KeyType,ValueType> getCache()
protected void setCache(com.google.common.collect.Multimap<KeyType,ValueType> cache)
cache
- the cache to setpublic int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public boolean containsEntry(java.lang.Object key, java.lang.Object value)
public java.util.Set<KeyType> keySet()
The returned set is immutable.
public com.google.common.collect.Multiset<KeyType> keys()
The returned multiset is immutable.
public java.util.Collection<ValueType> values()
The returned collection is immutable.
public java.util.Collection<java.util.Map.Entry<KeyType,ValueType>> entries()
The returned collection is immutable.
public java.util.Map<KeyType,java.util.Collection<ValueType>> asMap()
The returned map is immutable.
public boolean put(KeyType key, ValueType value)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
public boolean remove(java.lang.Object key, java.lang.Object value)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
public boolean putAll(KeyType key, java.lang.Iterable<? extends ValueType> values)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
public boolean putAll(com.google.common.collect.Multimap<? extends KeyType,? extends ValueType> multimap)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
public java.util.Collection<ValueType> replaceValues(KeyType key, java.lang.Iterable<? extends ValueType> values)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
The returned collection is immutable.
public java.util.Collection<ValueType> removeAll(java.lang.Object key)
Throws UnsupportedOperationException
if there is no IQueryResultSetter
The returned collection is immutable.
public void clear()
Throws UnsupportedOperationException
if there is no IQueryResultSetter