java.lang.Object
java.util.Spliterators.AbstractSpliterator<Arc<V,A>>
org.jhotdraw8.collection.enumerator.AbstractEnumerator<Arc<V,A>>
org.jhotdraw8.graph.iterator.BfsDfsArcSpliterator<V,A>
- Type Parameters:
V- the vertex data typeA- the arrow data type
- All Implemented Interfaces:
Spliterator<Arc<V,,A>> BareEnumerator<Arc<V,,A>> Enumerator<Arc<V,A>>
Enumerates arcs in a graph starting from a root vertex in
breadth-first-order or in depth-first-order.
- Author:
- Werner Randelshofer
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jhotdraw8.collection.enumerator.Enumerator
Enumerator.OfDouble, Enumerator.OfInt, Enumerator.OfLongNested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from class org.jhotdraw8.collection.enumerator.AbstractEnumerator
currentFields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.jhotdraw8.collection.enumerator.AbstractEnumerator
currentMethods inherited from class java.util.Spliterators.AbstractSpliterator
characteristics, estimateSize, trySplitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.collection.enumerator.Enumerator
tryAdvanceMethods inherited from interface java.util.Spliterator
characteristics, estimateSize, forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics, trySplit
-
Constructor Details
-
BfsDfsArcSpliterator
Creates a new instance.- Parameters:
nextArcsFunction- the nextFunctionroot- the root vertexdfs- whether to perform depth-first-search instead of breadth-first-search
-
BfsDfsArcSpliterator
public BfsDfsArcSpliterator(@Nullable Function<V, Iterable<Arc<V, A>>> nextFunction, @Nullable V root, @Nullable AddToSet<Arc<V, A>> visited, boolean dfs) Creates a new instance.- Parameters:
nextFunction- the function that returns the next vertices of a given vertexroot- the root vertexvisited- a function that adds an arc to a set, and returns true if the arc was not yet in the setdfs- whether to perform depth-first-search instead of breadth-first-search
-
-
Method Details
-
moveNext
public boolean moveNext()
-