Package com.adobe.xfa

Class ElementNodeList

  • All Implemented Interfaces:
    Peer

    public final class ElementNodeList
    extends NodeList
    This class implements the NodeList interface based on a set of nodes represented as the children of an element.

    The NodeList interface is best suited to array storage, whereas an Element stores children as a linked list. To compensate, we'll track our position in the linked list so that normal forward iterations should be efficient.

    • Method Detail

      • append

        public void append​(Obj newNode)
        Description copied from class: ListBase
        Appends an object to the end of this list.
        Specified by:
        append in class ListBase
        Parameters:
        newNode - the node to be appended.
        See Also:
        ListBase.append(Obj)
      • clone

        public java.lang.Object clone()
        Create a copy of this list.

        This method does not make copies of the underlying object implementations, it just place them in a new storage.
        Specified by:
        clone in class NodeList
        Returns:
        a new list
      • getClassAtom

        public java.lang.String getClassAtom()
        Description copied from class: Obj
        Returns the atomic name of this element's class.
        Overrides:
        getClassAtom in class ListBase
        Returns:
        the class name as an interned string.
        See Also:
        Obj.getClassAtom()
      • getClassName

        public java.lang.String getClassName()
        Description copied from class: Obj
        Gets the name of this object's class. Overriden by derived classes such as Element that have a local name that may be returned instead.
        Overrides:
        getClassName in class ListBase
        Returns:
        the class name.
        See Also:
        Obj.getClassName()
      • getNamedItem

        public Node getNamedItem​(java.lang.String name)
        Description copied from class: NodeList
        Gets the first child of this node list with the given name.
        Specified by:
        getNamedItem in class NodeList
        Parameters:
        name - the name of the child node.
        Returns:
        the first child of this node with the given name.
      • getNamedItem

        public Node getNamedItem​(java.lang.String aName,
                                 java.lang.String aClassName,
                                 int nTargetOccurrence)
        Description copied from class: NodeList
        Get the first child of this node with the given name
        Specified by:
        getNamedItem in class NodeList
        Parameters:
        aName - the name of the node to search for.
        aClassName - the class of node to search for, ignored if null. If non-null, this String must be interned.
        nTargetOccurrence - the occurrence to search for.
        Returns:
        the first child of this node with the given name and classname.
        See Also:
        NodeList.getNamedItem(String, String, int)
      • insert

        public void insert​(Obj newNode,
                           Obj refNode)
        Description copied from class: ListBase
        Inserts an object before a specific node in this list.
        Specified by:
        insert in class ListBase
        Parameters:
        newNode - the object to be inserted.
        refNode - the object to insert before.
        See Also:
        ListBase.insert(Obj, Obj)
      • item

        public Obj item​(int index)
        Description copied from class: ListBase
        Gets this list's n'th object.
        Specified by:
        item in class ListBase
        Parameters:
        index - the 0-based index of the node within this list.
        Returns:
        the n'th node.
        See Also:
        ListBase.item(int)
      • length

        public int length()
        Description copied from class: ListBase
        Returns the number of objects in this list.
        Specified by:
        length in class ListBase
        Returns:
        the length of this list.
      • remove

        public void remove​(Obj removeNode)
        Description copied from class: ListBase
        Removes an object from this list.
        Specified by:
        remove in class ListBase
        Parameters:
        removeNode - the object to be removed.
        See Also:
        ListBase.remove(Obj)