com.sas.collection
Class AVLNode.Cursor

java.lang.Object
  |
  +--com.sas.collection.AVLNode.Cursor
All Implemented Interfaces:
Enclosing class:
AVLNode

public static class AVLNode.Cursor
extends java.lang.Object
implements java.util.Enumeration

Cursor is an Enumeration for AVLNodes in an AVLTree. It works like an Enumeration but also provides backward enumeration.


Constructor Summary
AVLNode.Cursor(AVLNode root, boolean reversedOrder)
          Construct an AVLNode cursor.
 
Method Summary
 Object backwardElement()
          Return the element in the backward direction.
 Object forwardElement()
          Return the element in the forward direction.
 boolean hasBackwardElement()
          Return true if there are more elements in the backward direction.
 boolean hasForwardElement()
          Return true if there are more elements in the forward direction.
 boolean hasMoreElements()
          Return true if this enumeration has more elements.
 Object nextElement()
          Return the next element in this enumeration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AVLNode.Cursor

public AVLNode.Cursor(AVLNode root,
                      boolean reversedOrder)
Construct an AVLNode cursor.
Parameters:
reversedOrder - if true, start at the rightmost descendent and move backwards, else start at the leftmost descendent and move forwards.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Return true if this enumeration has more elements.
Specified by:
hasMoreElements in interface Enumeration

nextElement

public Object nextElement()
Return the next element in this enumeration.
Specified by:
nextElement in interface Enumeration
Throws:
NoSuchElementException - if there are no more items.
See Also:
hasMoreElements()

hasForwardElement

public boolean hasForwardElement()
Return true if there are more elements in the forward direction.

forwardElement

public Object forwardElement()
Return the element in the forward direction.

hasBackwardElement

public boolean hasBackwardElement()
Return true if there are more elements in the backward direction.

backwardElement

public Object backwardElement()
Return the element in the backward direction.




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 01:48:09