Class Attributed

    • Constructor Summary

      Constructors 
      Constructor Description
      Attributed()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      removes all key/value mappings
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.String>> entrySet()
      Returns a Set containing the key/value entry associations
      java.lang.String getAttribute​(java.lang.String key)
      gets the value of the given attribute name
      java.util.Map<java.lang.String,​java.lang.String> getAttributes()
      Returns an unmodifiable view of the attribute map
      java.lang.String getDescription()
      gets the description of this Attributed object.
      boolean hasAttribute​(java.lang.String key)
      Returns true if there is an attribute with that name
      boolean isEmpty()
      Return true if there are no attributes
      java.util.Set<java.lang.String> keys()
      Returns the keys for the attributes
      void putAttributes​(java.util.Map<java.lang.String,​java.lang.String> map)
      Adds all the key/value pairs from the given map as attributes
      java.lang.String removeAttribute​(java.lang.String key)
      Removes the attribute with the given key
      java.lang.String setAttribute​(java.lang.String key, java.lang.String value)
      Sets the attribute with the given key and value
      java.lang.String setDescription​(java.lang.String value)
      Sets a description for this Attributed object
      int size()
      Returns the number of attributes defined
      java.util.Collection<java.lang.String> values()
      Returns the attribute values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Attributed

        public Attributed()
    • Method Detail

      • getAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Returns an unmodifiable view of the attribute map
        Returns:
        an unmodifiable view of the attribute map
      • setAttribute

        public java.lang.String setAttribute​(java.lang.String key,
                                             java.lang.String value)
        Sets the attribute with the given key and value
        Parameters:
        key - attribute key
        value - attribute value
        Returns:
        the previous value of the attribute
      • getAttribute

        public java.lang.String getAttribute​(java.lang.String key)
        gets the value of the given attribute name
        Parameters:
        key - attribute name
        Returns:
        the mapped value for the supplied key
      • removeAttribute

        public java.lang.String removeAttribute​(java.lang.String key)
        Removes the attribute with the given key
        Parameters:
        key - attribute key
        Returns:
        the value of the removed attribute
      • hasAttribute

        public boolean hasAttribute​(java.lang.String key)
        Returns true if there is an attribute with that name
        Parameters:
        key - attribute key
        Returns:
        true if there is an attribute with that name
      • size

        public int size()
        Returns the number of attributes defined
        Returns:
        the number of attributes defined
      • isEmpty

        public boolean isEmpty()
        Return true if there are no attributes
        Returns:
        true if there are no mapped attributes
      • putAttributes

        public void putAttributes​(java.util.Map<java.lang.String,​java.lang.String> map)
        Adds all the key/value pairs from the given map as attributes
        Parameters:
        map - a map of key/values to add as attributes
      • clear

        public void clear()
        removes all key/value mappings
      • keys

        public java.util.Set<java.lang.String> keys()
        Returns the keys for the attributes
        Returns:
        the keys for the attributes
      • values

        public java.util.Collection<java.lang.String> values()
        Returns the attribute values
        Returns:
        the attribute values
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.String>> entrySet()
        Returns a Set containing the key/value entry associations
        Returns:
        a Set containing the key/value entry associations
      • setDescription

        public java.lang.String setDescription​(java.lang.String value)
        Sets a description for this Attributed object
        Parameters:
        value - text that provides a description for this Attributed object. The text can be either a plain string or an HTML string.
        Returns:
        the previously set description
      • getDescription

        public java.lang.String getDescription()
        gets the description of this Attributed object.
        Returns:
        the description of this Attributed object.