public abstract class NodeIterator extends java.lang.Object implements IntIterator
IntIteratorand is used to scan a graph, that is, to read its nodes and their successor lists sequentially. The
IntIterator.nextInt()method returns the node that will be scanned. After a call to this method, calling
successorArray()will return the list of successors.
copy(int) methods is in fact optional, but should be implemented whenever the graph can be
scanned more than once.
|Modifier and Type||Field and Description|
An empty node iterator.
|Constructor and Description|
|Modifier and Type||Method and Description|
Creates a copy of this iterator that will never return nodes ≥ the specified bound; the copy must be accessible by a different thread.
Returns the outdegree of the current node.
Returns a reference to an array containing the successors of the current node.
Returns a lazy iterator over the successors of the current node.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, next, nextInt, skip
public static final NodeIterator EMPTY
public abstract int outdegree()
public LazyIntIterator successors()
This implementation just wraps the array returned by
public int successorArray()
The returned array may contain more entries than the outdegree of the current node. However, only those with indices from 0 (inclusive) to the outdegree of the current node (exclusive) contain valid data.
This implementation just unwrap the iterator returned by
public NodeIterator copy(int upperBound)
This implementation just throws an
UnsupportedOperationException. It should be kept
in sync with the result of
upperBound- the upper bound.