Interface ICStorageElement

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Erases all children, attributes and any value set on this ICStorageElement
      ICStorageElement createChild​(java.lang.String name)
      Create a child ICStorageElement with the given name.
      ICStorageElement createCopy()
      Create a deep copy of the current ICStorageElement such that name, children, attributes and value are the same.
      boolean equals​(ICStorageElement other)
      Tests whether this storage element is exactly equal to other To be equal all name, children attributes and value must be equal between the two ICStorageElements
      java.lang.String getAttribute​(java.lang.String name)
      Return the String of attribute value for name.
      java.lang.String[] getAttributeNames()
      Returns a string array of attribute names
      ICStorageElement[] getChildren()
      Returns an array of the ICStorageElement children of this ICStorageElement or an empty array if no children were found
      ICStorageElement[] getChildrenByName​(java.lang.String name)
      Returns the children ICStorageElements with name name
      java.lang.String getName()
      Returns the name of this ICStorageElement
      ICStorageElement getParent()
      Return the parent IStorageElement or null if this ICStorageElement doesn't have a parent
      java.lang.String getValue()
      Returns the String value of this element or null if there is no String value set.
      boolean hasAttribute​(java.lang.String name)
      Return whether this ICStorageElement contains an attribute value for name
      boolean hasChildren()
      Returns true if this storage element has child ICStorageElements
      ICStorageElement importChild​(ICStorageElement element)
      Imports an existing ICStorageElemtn as a child of this ICStorageElement
      void removeAttribute​(java.lang.String name)
      Remove an attribute from this ICStorageElement
      void removeChild​(ICStorageElement el)
      Removes the ICStorageElement from the set of child ICSotrageElements
      void setAttribute​(java.lang.String name, java.lang.String value)
      Set an attribute on this ICStorageElement
      void setValue​(java.lang.String value)
      Sets a String value on the ICStorageElement
    • Method Detail

      • getAttribute

        java.lang.String getAttribute​(java.lang.String name)
        Return the String of attribute value for name. If attribute is not found (hasAttribute(name) is false) this method returns null
        Parameters:
        name -
        Returns:
        String value or null if hasAttribute is false
      • hasAttribute

        boolean hasAttribute​(java.lang.String name)
        Return whether this ICStorageElement contains an attribute value for name
        Parameters:
        name -
        Returns:
        boolean indicating existence of attribute with name name
        Since:
        5.1
      • getAttributeNames

        java.lang.String[] getAttributeNames()
        Returns a string array of attribute names
      • getParent

        ICStorageElement getParent()
        Return the parent IStorageElement or null if this ICStorageElement doesn't have a parent
        Returns:
        ICStorageElement parent or null
      • setAttribute

        void setAttribute​(java.lang.String name,
                          java.lang.String value)
        Set an attribute on this ICStorageElement
        Parameters:
        name -
        value -
      • removeAttribute

        void removeAttribute​(java.lang.String name)
        Remove an attribute from this ICStorageElement
        Parameters:
        name -
      • createChild

        ICStorageElement createChild​(java.lang.String name)
        Create a child ICStorageElement with the given name.
        Parameters:
        name -
        Returns:
        new ICStorageElement representing the child
      • getChildren

        ICStorageElement[] getChildren()
        Returns an array of the ICStorageElement children of this ICStorageElement or an empty array if no children were found
        Returns:
        ICStorageElement[] of children or empty array
      • getChildrenByName

        ICStorageElement[] getChildrenByName​(java.lang.String name)
        Returns the children ICStorageElements with name name
        Parameters:
        name - String name of children to be returned
        Returns:
        ICStorageElement[] of children may be the empty list if no children with name found
        Since:
        5.1
      • hasChildren

        boolean hasChildren()
        Returns true if this storage element has child ICStorageElements
        Returns:
        boolean indicating whether this ICStorageElement has children
        Since:
        5.1
      • clear

        void clear()
        Erases all children, attributes and any value set on this ICStorageElement
      • getName

        java.lang.String getName()
        Returns the name of this ICStorageElement
      • removeChild

        void removeChild​(ICStorageElement el)
        Removes the ICStorageElement from the set of child ICSotrageElements
        Parameters:
        el -
      • getValue

        java.lang.String getValue()
        Returns the String value of this element or null if there is no String value set. NB a pure whitespace value is considered to be null
        Returns:
        String or null
      • setValue

        void setValue​(java.lang.String value)
        Sets a String value on the ICStorageElement
        Parameters:
        value -
      • importChild

        ICStorageElement importChild​(ICStorageElement element)
                              throws java.lang.UnsupportedOperationException
        Imports an existing ICStorageElemtn as a child of this ICStorageElement
        Parameters:
        element -
        Returns:
        ICStorageElement a handle on the newly imported ICStorageElement
        Throws:
        java.lang.UnsupportedOperationException
      • createCopy

        ICStorageElement createCopy()
                             throws java.lang.UnsupportedOperationException,
                                    org.eclipse.core.runtime.CoreException
        Create a deep copy of the current ICStorageElement such that name, children, attributes and value are the same.
        However this is implemented it should appear to the user that a deep copy of the elements within has occurred. [ Though the implementation may be copy-on-write if the underlying data structure is suitable. ]

        getParent() of the clone should be equal to the original element.getParent(). However the clone() doesn't appear in the parent's getChildren() array.
        Returns:
        ICStorageElement deep copy of this ICStorageElement
        Throws:
        java.lang.UnsupportedOperationException
        org.eclipse.core.runtime.CoreException
        Since:
        5.1
      • equals

        boolean equals​(ICStorageElement other)
        Tests whether this storage element is exactly equal to other To be equal all name, children attributes and value must be equal between the two ICStorageElements
        Parameters:
        other -
        Returns:
        boolean indicating equality
        Since:
        5.1