Package ca.uqac.lif.cep.tuples
Class TupleMap
- java.lang.Object
-
- ca.uqac.lif.cep.tuples.Tuple
-
- ca.uqac.lif.cep.tuples.TupleMap
-
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable
,java.util.Map<java.lang.String,java.lang.Object>
public class TupleMap extends Tuple implements ca.uqac.lif.cep.Duplicable
Implementation of a named tuple based on theMap
class. This named tuple is mutable: its contents can be modified during its life cycle. This should be contrasted with theTupleFixed
, whose contents are set at instantiation and cannot be changed afterwards.- Author:
- Sylvain Hallé
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ca.uqac.lif.cep.tuples.Tuple
Tuple.MapEntry<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
m_contents
The contents of the named tuple
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object arg0)
boolean
containsValue(java.lang.Object value)
TupleMap
duplicate(boolean with_state)
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
boolean
equals(java.lang.Object o)
java.lang.Object
get(java.lang.Object key)
int
hashCode()
boolean
isEmpty()
java.util.Set<java.lang.String>
keySet()
java.lang.Object
put(java.lang.String key, java.lang.Object value)
void
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m)
java.lang.Object
remove(java.lang.Object key)
int
size()
java.lang.String
toString()
java.util.Collection<java.lang.Object>
values()
-
-
-
Constructor Detail
-
TupleMap
public TupleMap()
Creates a new named tple
-
TupleMap
public TupleMap(java.lang.String[] names, java.lang.Object[] values)
-
TupleMap
public TupleMap(TupleMap ntm)
Creates a new named tuple by copying the contents of an existing named tuple- Parameters:
ntm
- The named tuple to copy from
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object arg0)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
equals
in classjava.lang.Object
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
hashCode
in classjava.lang.Object
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> m)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-