Class Navigation<T extends Selection>

    • Constructor Detail

      • Navigation

        public Navigation()
    • Method Detail

      • hasNext

        public abstract boolean hasNext()
        Return true if document still has more matched Selection when traversing the document(In other words return true if next() would return an element instance rather than return null)
        Specified by:
        hasNext in interface Iterator<T extends Selection>
        Returns:
        true if document still has more matched Selection, and vice versa
      • getElement

        public abstract OdfElement getElement()
      • next

        public abstract T next()
        get the current Selection result
        Specified by:
        next in interface Iterator<T extends Selection>
        Returns:
        the current Selection result
      • match

        public abstract boolean match​(Node element)
        check if the element match the user defined condition
        Parameters:
        element - navigate this element
        Returns:
        true if the element match the user defined condition; false if not match
      • getNextMatchElement

        protected Node getNextMatchElement​(Node startpoint)
        get the next matched element in a whole dom tree
        Parameters:
        startpoint - navigate from the startpoint
        Returns:
        the next matched element
      • getNextMatchElementInTree

        protected Node getNextMatchElementInTree​(Node startpoint,
                                                 Node root)
        get the next matched element in a sub tree
        Parameters:
        startpoint - navigate from the startpoint
        root - the root of the sub tree
        Returns:
        the next matched element