Class ParameterElement

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    Component, Message

    public abstract class ParameterElement
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable
    Base class for agents and messages. This class provides the common elements such as the parameter attribute and the setters and getters for the parameters.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CLASS  
      static java.lang.String NAME  
      protected java.util.Map<java.lang.String,​java.lang.Object> parameters
      The parameters.
      protected boolean visible
      The visibility
    • Constructor Summary

      Constructors 
      Constructor Description
      ParameterElement()
      Default constructor
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.lang.Object o)
      Elements are compared by their ids.
      boolean equals​(java.lang.Object obj)
      Only messages with the same id are equal.
      abstract java.lang.String getId()  
      java.lang.Object getParameter​(java.lang.String name)
      Returns a parameter value.
      java.util.Map getParameters()
      Returns the parameter map.
      boolean hasParameter​(java.lang.String name)
      Checks if a given parameter is contained by the parameter map.
      boolean isVisible()  
      void setParameter​(java.lang.String name, java.lang.Object value)
      Sets a parameter value
      void setParameters​(java.util.Map map)
      Replaces the existing parameter map.
      void setVisible​(boolean visible)
      Set the visbile state.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • visible

        protected boolean visible
        The visibility
      • parameters

        protected java.util.Map<java.lang.String,​java.lang.Object> parameters
        The parameters.
    • Constructor Detail

      • ParameterElement

        public ParameterElement()
        Default constructor
    • Method Detail

      • getParameters

        public java.util.Map getParameters()
        Returns the parameter map.
        Returns:
        The parameter map.
      • getParameter

        public java.lang.Object getParameter​(java.lang.String name)
        Returns a parameter value.
        Parameters:
        name - The name of the parameter.
        Returns:
        The value.
      • setParameters

        public void setParameters​(java.util.Map map)
        Replaces the existing parameter map.
        Parameters:
        map - The parameter map.
      • setParameter

        public void setParameter​(java.lang.String name,
                                 java.lang.Object value)
        Sets a parameter value
        Parameters:
        name - The name of the parameter.
        value - The value.
      • hasParameter

        public boolean hasParameter​(java.lang.String name)
        Checks if a given parameter is contained by the parameter map.
        Parameters:
        name - The name of the parameter.
        Returns:
        true if the parameter is contained.
      • isVisible

        public boolean isVisible()
        Returns:
        The visiblity.
      • setVisible

        public void setVisible​(boolean visible)
        Set the visbile state.
        Parameters:
        visible - The visible state.
      • getId

        public abstract java.lang.String getId()
        Returns:
        The id of the element.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Elements are compared by their ids.
        Specified by:
        compareTo in interface java.lang.Comparable
      • equals

        public boolean equals​(java.lang.Object obj)
        Only messages with the same id are equal.
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation for the element.