示例#1
0
  /**
   * Obtain the contents of the current node.
   *
   * @timing O(1)
   * @precond itemExists()
   */
  public I item() throws NoCurrentItem280Exception {
    if (!itemExists()) throw new NoCurrentItem280Exception("A current item must exist");

    return cur.item();
  }
示例#2
0
 /**
  * Advance to the root of the ith subtree.
  *
  * @timing O(1)
  * @param i subtree to advance to
  */
 public void goSubtree(int i) {
   parent = cur;
   index = i;
   cur = cur.subnode(i);
 }