Class 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 the Map class. This named tuple is mutable: its contents can be modified during its life cycle. This should be contrasted with the TupleFixed, whose contents are set at instantiation and cannot be changed afterwards.
    Author:
    Sylvain Hallé
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      TupleMap()
      Creates a new named tple
      TupleMap​(TupleMap ntm)
      Creates a new named tuple by copying the contents of an existing named tuple
      TupleMap​(java.lang.String[] names, java.lang.Object[] values)  
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface ca.uqac.lif.cep.Duplicable

        duplicate
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • m_contents

        protected java.util.Map<java.lang.String,​java.lang.Object> m_contents
        The contents of the named tuple
    • 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 interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsKey

        public boolean containsKey​(java.lang.Object arg0)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.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 interface java.util.Map<java.lang.String,​java.lang.Object>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        equals in class java.lang.Object
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.Object>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        hashCode in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.lang.Object>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.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 interface java.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 interface java.util.Map<java.lang.String,​java.lang.Object>
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.lang.Object>
      • values

        public java.util.Collection<java.lang.Object> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.lang.Object>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • duplicate

        public TupleMap duplicate​(boolean with_state)
        Specified by:
        duplicate in interface ca.uqac.lif.cep.Duplicable
        Specified by:
        duplicate in class Tuple