src/java.xml/share/classes/org/w3c/dom/ElementTraversal.java

Print this page




  33  * [1] http://www.w3.org/Consortium/Legal/copyright-software
  34  */
  35 
  36 package org.w3c.dom;
  37 
  38 /**
  39  * The {@code ElementTraversal} interface is a set of read-only attributes
  40  * which allow an author to easily navigate between elements in a document.
  41  * <p>
  42  * In conforming implementations of Element Traversal, all objects that
  43  * implement {@link Element} must also implement the {@code ElementTraversal}
  44  * interface. Four of the methods,
  45  * {@link #getFirstElementChild}, {@link #getLastElementChild},
  46  * {@link #getPreviousElementSibling}, and {@link #getNextElementSibling},
  47  * each provides a live reference to another element with the defined
  48  * relationship to the current element, if the related element exists. The
  49  * fifth method, {@link #getChildElementCount}, exposes the number of child
  50  * elements of an element, for preprocessing before navigation.
  51  *
  52  * @see
  53  * <a href='http://www.w3.org/TR/ElementTraversal/'><cite>Element Traversal Specification</cite></a>.
  54  *
  55  * @since 9
  56  */
  57 public interface ElementTraversal {
  58 
  59     /**
  60      * Returns a reference to the first child node of the element which is of
  61      * the {@link Element} type.
  62      *
  63      * @return a reference to an element child, {@code null} if the element has
  64      * no child of the {@link Element} type.
  65      */
  66     Element getFirstElementChild();
  67 
  68     /**
  69      * Returns a reference to the last child node of the element which is of
  70      * the {@link Element} type.
  71      *
  72      * @return a reference to an element child, {@code null} if the element has
  73      * no child of the {@link Element} type.




  33  * [1] http://www.w3.org/Consortium/Legal/copyright-software
  34  */
  35 
  36 package org.w3c.dom;
  37 
  38 /**
  39  * The {@code ElementTraversal} interface is a set of read-only attributes
  40  * which allow an author to easily navigate between elements in a document.
  41  * <p>
  42  * In conforming implementations of Element Traversal, all objects that
  43  * implement {@link Element} must also implement the {@code ElementTraversal}
  44  * interface. Four of the methods,
  45  * {@link #getFirstElementChild}, {@link #getLastElementChild},
  46  * {@link #getPreviousElementSibling}, and {@link #getNextElementSibling},
  47  * each provides a live reference to another element with the defined
  48  * relationship to the current element, if the related element exists. The
  49  * fifth method, {@link #getChildElementCount}, exposes the number of child
  50  * elements of an element, for preprocessing before navigation.
  51  *
  52  * @see
  53  * <a href='http://www.w3.org/TR/ElementTraversal/'><cite>Element Traversal Specification</cite></a>
  54  *
  55  * @since 9
  56  */
  57 public interface ElementTraversal {
  58 
  59     /**
  60      * Returns a reference to the first child node of the element which is of
  61      * the {@link Element} type.
  62      *
  63      * @return a reference to an element child, {@code null} if the element has
  64      * no child of the {@link Element} type.
  65      */
  66     Element getFirstElementChild();
  67 
  68     /**
  69      * Returns a reference to the last child node of the element which is of
  70      * the {@link Element} type.
  71      *
  72      * @return a reference to an element child, {@code null} if the element has
  73      * no child of the {@link Element} type.