@InterfaceAudience.Private public static class AvlUtil.AvlTreeIterator<TNode extends AvlUtil.AvlNode> extends Object implements Iterator<TNode>
Constructor and Description |
---|
AvlTreeIterator() |
AvlTreeIterator(TNode root)
Create the iterator starting from the first (min) node of the tree
|
AvlTreeIterator(TNode root,
Object key,
AvlUtil.AvlKeyComparator<TNode> keyComparator)
Create the iterator starting from the specified key
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
TNode |
next() |
void |
remove() |
void |
seekFirst(TNode root)
Reset the iterator, and seeks to the first (min) node of the tree
|
void |
seekTo(TNode root,
Object key,
AvlUtil.AvlKeyComparator<TNode> keyComparator)
Reset the iterator, and seeks to the specified key
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public AvlTreeIterator()
public AvlTreeIterator(TNode root)
public AvlTreeIterator(TNode root, Object key, AvlUtil.AvlKeyComparator<TNode> keyComparator)
root
- the current root of the treekey
- the key for the node we are trying to findkeyComparator
- the comparator to use to match node and keypublic boolean hasNext()
hasNext
in interface Iterator<TNode extends AvlUtil.AvlNode>
public TNode next()
next
in interface Iterator<TNode extends AvlUtil.AvlNode>
public void remove()
remove
in interface Iterator<TNode extends AvlUtil.AvlNode>
public void seekFirst(TNode root)
root
- the current root of the treepublic void seekTo(TNode root, Object key, AvlUtil.AvlKeyComparator<TNode> keyComparator)
root
- the current root of the treekey
- the key for the node we are trying to findkeyComparator
- the comparator to use to match node and keyCopyright © 2007–2019 Cloudera. All rights reserved.