Class ConfigurationNode

    • Field Detail

      • attributes

        protected java.util.Map<java.lang.String,​java.lang.String> attributes
      • type

        protected java.lang.String type
      • value

        protected java.lang.String value
      • readOnly

        protected boolean readOnly
    • Constructor Detail

      • ConfigurationNode

        public ConfigurationNode​(java.lang.String type)
        Constructor.
      • ConfigurationNode

        public ConfigurationNode​(ConfigurationNode source)
        Duplication constructor.
    • Method Detail

      • createNewNode

        protected ConfigurationNode createNewNode()
        Make a new blank node identical in type and class to the current node.
        Returns:
        the new node.
      • makeReadOnly

        public void makeReadOnly()
        Make this node (and its children) read-only
      • createDuplicate

        protected ConfigurationNode createDuplicate​(boolean readOnly)
        Create a duplicate of the current node.
        Returns:
        the duplicate
      • getType

        public java.lang.String getType()
        Get type.
        Returns:
        the node type.
      • setValue

        public void setValue​(java.lang.String value)
        Set value.
        Parameters:
        value - is the value to set.
      • getValue

        public java.lang.String getValue()
        Get value.
        Returns:
        the value.
      • removeChild

        public void removeChild​(int index)
        Remove child n.
        Specified by:
        removeChild in interface IHierarchyParent
        Parameters:
        index - is the child to remove.
      • addChild

        public void addChild​(int index,
                             ConfigurationNode child)
        Add child at specified position.
        Specified by:
        addChild in interface IHierarchyParent
        Parameters:
        index - is the position to add the child.
        child - is the child to add.
      • setAttribute

        public void setAttribute​(java.lang.String attribute,
                                 java.lang.String value)
        Set an attribute.
        Parameters:
        attribute - is the name of the attribute.
        value - is the value of the attribute (null to remove it).
      • getAttributeCount

        public int getAttributeCount()
        Get the attribute count.
        Returns:
        the attribute count.
      • getAttributes

        public java.util.Iterator<java.lang.String> getAttributes()
        Iterate over attributes.
        Returns:
        the attribute iterator.
      • getAttributeValue

        public java.lang.String getAttributeValue​(java.lang.String attribute)
        Get an attribute value.
        Parameters:
        attribute - is the name of the attribute.
        Returns:
        the value.
      • hashCode

        public int hashCode()
        Calculate a hashcode
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Check if equals
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Construct a human-readable string
        Overrides:
        toString in class java.lang.Object
      • cloneAttributes

        protected static java.util.Map<java.lang.String,​java.lang.String> cloneAttributes​(java.util.Map<java.lang.String,​java.lang.String> attributes)