Class ExtElements

    • Constructor Detail

      • ExtElements

        public ExtElements()
        Creates an empty ExtElements object.
      • ExtElements

        public ExtElements​(ExtElements original)
        Copy constructor.
        Parameters:
        original - the original object to duplicate.
    • Method Detail

      • add

        public ExtElement add​(ExtElement element)
        Adds an element to this set.
        Parameters:
        element - the element to add.
        Returns:
        the added element (same as the parameter).
      • add

        public ExtElement add​(String namespaceURI,
                              String localPart,
                              String prefix)
        Adds a new ExtElement object to this set.
        Parameters:
        namespaceURI - the namespace URI of the element.
        localPart - the locale part of the element name.
        prefix - the prefix.
        Returns:
        the element created.
      • size

        public int size()
        Gets the number of elements in this set.
        Returns:
        the number of elements in this set.
      • isEmpty

        public boolean isEmpty()
        Indicates if this set has at least one element.
        Returns:
        true if this set as at least one element, false if it has none.
      • get

        public ExtElement get​(int index)
        Gets the element at a given position.
        Parameters:
        index - the position of the element to retrieve.
        Returns:
        the element at the given position.
        Throws:
        IndexOutOfBoundsException - if the position is invalid.
      • find

        public List<ExtElement> find​(String namespaceURI,
                                     String localName)
        Gets a list of all child elements for a given namespace and name for this element (not recursively)
        Parameters:
        namespaceURI - the namespace of the elements to list.
        localName - the name of the elements to list.
        Returns:
        the list (it may be empty, but never null)
      • getOrCreate

        public ExtElement getOrCreate​(String namespaceURI,
                                      String localName,
                                      String prefix)
        Get and if needed, create before, a given element from this set.
        Parameters:
        namespaceURI - the namespace of the element.
        localName - the name of the element.
        prefix - the prefix to use if it needs to be created.
        Returns:
        the element searched for: the first existing one, or one just created.