Algorithm
Development Kit 1.0

algs.model.tree
Class ValueExtractor<T>

java.lang.Object
  extended by algs.model.tree.ValueExtractor<T>
Type Parameters:
T - the base type of the values stored by the BinaryTree. Must be
All Implemented Interfaces:
java.util.Iterator<T>

public class ValueExtractor<T>
extends java.lang.Object
implements java.util.Iterator<T>

Wraps a BinaryNode iterator to be able to extract in a type-safe way the values of the BinaryNodes.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
 boolean hasNext()
          Delegate request to the internal iterator.
 T next()
          Delegate request to the internal iterator and extract its value.
 void remove()
          Immutable iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Delegate request to the internal iterator.

Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
Delegate request to the internal iterator and extract its value.

Specified by:
next in interface java.util.Iterator<T>

remove

public void remove()
Immutable iterator.

Specified by:
remove in interface java.util.Iterator<T>

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.