Class BiItem


  • public class BiItem
    extends Object
    A BiItem can be any MessageML element such as , ,

    , etc.

    • Constructor Detail

      • BiItem

        public BiItem​(String name,
                      String attribute)
        Constructor which takes an item name and an attribute name and initialize a map of attribute setting the attribute value by default to 1.
        Parameters:
        name - ot the item to be created
        attribute - name of the attribute to be included in the attributes map
    • Method Detail

      • getName

        public String getName()
        Returns the name of the MessageML element
      • getAttributes

        public Map<String,​Object> getAttributes()
        Returns a map containing all the attributes for a specific MessageML element. The map is composed by a key/value pair where the key is the name of the attribute and the value is either the number of occurrences for generic attributes of the value or the attribute it self (e.g Button type can be either "action" or "reset"). If a specific attribute is not present the respective value will be set to an empty string.
      • increaseAttributeCount

        protected void increaseAttributeCount​(String attributeName)
        If the attribute is found inside the map the corresponding value will be increased, otherwise the attribute will be put in the map with value 1. If the value found is not an integer, then no update will be performed.
        Parameters:
        attributeName - name of the attribute to be increased in value
      • setMaxAttribute

        protected void setMaxAttribute​(String attributeName,
                                       Integer attributeValue)
        If the attribute is found inside the map this method will set the corresponding value with the max found between the current one and the one in input, otherwise the attribute will be put in the map with the attribute value passed as input. If the value found is not an integer, then no update will be performed
        Parameters:
        attributeName - name of the attribute to be checked
        attributeValue - value of the attribute to be checked
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object