Class GroupedMap<GroupedKeyType,ValueType>
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.aggregation.GroupedMap<GroupedKeyType,ValueType>
-
- All Implemented Interfaces:
java.util.Map<Tuple,ValueType>
public class GroupedMap<GroupedKeyType,ValueType> extends java.lang.Object implements java.util.Map<Tuple,ValueType>
An optimizedMap
implementation where each key is produced by joining together a group tuple and some other object (via left inheritance). Only a select fewMap
operations are supported. This collection is unmodifiable. Operations on this map assume that client queries also obey the contract that keys are constructed from a group tuple and an additional object.- Since:
- 2.4
-
-
Field Summary
Fields Modifier and Type Field Description protected Tuple
group
protected java.util.Map<GroupedKeyType,ValueType>
mappings
protected IQueryRuntimeContext
runtimeContext
-
Constructor Summary
Constructors Constructor Description GroupedMap(Tuple group, java.util.Map<GroupedKeyType,ValueType> mappings, IQueryRuntimeContext runtimeContext)
-
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<Tuple,ValueType>>
entrySet()
ValueType
get(java.lang.Object key)
boolean
isEmpty()
java.util.Set<Tuple>
keySet()
ValueType
put(Tuple key, ValueType value)
void
putAll(java.util.Map<? extends Tuple,? extends ValueType> map)
ValueType
remove(java.lang.Object key)
int
size()
java.util.Collection<ValueType>
values()
-
-
-
Field Detail
-
group
protected final Tuple group
-
mappings
protected final java.util.Map<GroupedKeyType,ValueType> mappings
-
runtimeContext
protected final IQueryRuntimeContext runtimeContext
-
-
Constructor Detail
-
GroupedMap
public GroupedMap(Tuple group, java.util.Map<GroupedKeyType,ValueType> mappings, IQueryRuntimeContext runtimeContext)
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
get
public ValueType get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
put
public ValueType put(Tuple key, ValueType value)
- Specified by:
put
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
remove
public ValueType remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
putAll
public void putAll(java.util.Map<? extends Tuple,? extends ValueType> map)
- Specified by:
putAll
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
keySet
public java.util.Set<Tuple> keySet()
- Specified by:
keySet
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
values
public java.util.Collection<ValueType> values()
- Specified by:
values
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
entrySet
public java.util.Set<java.util.Map.Entry<Tuple,ValueType>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<GroupedKeyType,ValueType>
-
-