Class AbstractPostfixDepthFirstTreeIterator<P extends IterableNode<? extends C>,C extends IterableNode<?>>
- java.lang.Object
-
- org.arakhne.afc.math.tree.iterator.AbstractPostfixDepthFirstTreeIterator<P,C>
-
- Type Parameters:
P- is the type of the parent nodes.C- is the type of the child nodes.
- All Implemented Interfaces:
Iterator<P>
- Direct Known Subclasses:
PostfixDepthFirstTreeIterator
public abstract class AbstractPostfixDepthFirstTreeIterator<P extends IterableNode<? extends C>,C extends IterableNode<?>> extends Object implements Iterator<P>
This class is an postfixed iterator on a tree. It treats the parent node after going inside the child nodes.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:41
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathtree
-
-
Constructor Summary
Constructors Constructor Description AbstractPostfixDepthFirstTreeIterator(P node)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanhasNext()protected abstract booleanisTraversableParent(P parent)Replies if an object to type N which is corresponding to the given child node retreived from the given parent node.Pnext()voidremove()protected abstract PtoTraversableChild(P parent, C child)Replies an object to type N which is corresponding to the given child node retreived from the given parent node.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
AbstractPostfixDepthFirstTreeIterator
public AbstractPostfixDepthFirstTreeIterator(P node)
Constructor.- Parameters:
node- is the node to iterate.
-
-
Method Detail
-
toTraversableChild
@Pure protected abstract P toTraversableChild(P parent, C child)
Replies an object to type N which is corresponding to the given child node retreived from the given parent node.- Parameters:
parent- is the node from which the child node was retreived.child- is the child node to test.- Returns:
- the traversable node, or
nullif the node is not traversable.
-
isTraversableParent
@Pure protected abstract boolean isTraversableParent(P parent)
Replies if an object to type N which is corresponding to the given child node retreived from the given parent node.- Parameters:
parent- is the node from which the child node was retreived.- Returns:
trueif the given node is traversable,falseotherwise.
-
hasNext
@Pure public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<P extends IterableNode<? extends C>>
-
remove
public void remove()
- Specified by:
removein interfaceIterator<P extends IterableNode<? extends C>>
-
-