gov.sandia.cognition.math.geometry
Class KDTree.InOrderKDTreeIterator<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>>

java.lang.Object
  extended by gov.sandia.cognition.math.geometry.KDTree.InOrderKDTreeIterator<VectorType,DataType,PairType>
Type Parameters:
VectorType - Type of Vectorizable, the first values
DataType - Type of data in the Pair, the second values
PairType - Type of Pair to use in the KDTree.
All Implemented Interfaces:
Iterator<PairType>
Enclosing class:
KDTree<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>>

@PublicationReference(author="Wikipedia",
                      title="Tree traversal",
                      type=WebPage,
                      year=2009,
                      url="http://en.wikipedia.org/wiki/Tree_traversal#Traversal")
protected static class KDTree.InOrderKDTreeIterator<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>>
extends Object
implements Iterator<PairType>

Iterates through the KDTree using "inorder", also known as "symmetric traversal", of the tree. That is, the recursion proceeds as traverse the left subtree, visit the node, traverse the right subtree.


Field Summary
 KDTree.InOrderKDTreeIterator<VectorType,DataType,PairType> leftIterator
          Iterator for the left subtree.
 PairType nodeValue
          Value of the node
 KDTree.InOrderKDTreeIterator<VectorType,DataType,PairType> rightIterator
          Iterator for the right subtree.
 
Constructor Summary
KDTree.InOrderKDTreeIterator(KDTree<VectorType,DataType,PairType> node)
          Creates a new instance of InOrderKDTreeIterator
 
Method Summary
 boolean hasNext()
           
 PairType next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeValue

public PairType extends Pair<? extends VectorType,DataType> nodeValue
Value of the node


leftIterator

public KDTree.InOrderKDTreeIterator<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>> leftIterator
Iterator for the left subtree.


rightIterator

public KDTree.InOrderKDTreeIterator<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>> rightIterator
Iterator for the right subtree.

Constructor Detail

KDTree.InOrderKDTreeIterator

public KDTree.InOrderKDTreeIterator(KDTree<VectorType,DataType,PairType> node)
Creates a new instance of InOrderKDTreeIterator

Parameters:
node - Node from which to iterate.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<PairType extends Pair<? extends VectorType,DataType>>

next

public PairType next()
Specified by:
next in interface Iterator<PairType extends Pair<? extends VectorType,DataType>>

remove

public void remove()
Specified by:
remove in interface Iterator<PairType extends Pair<? extends VectorType,DataType>>