public class GraphVisitorDFS<T> extends java.lang.Object implements GraphVisitor<T>
| Modifier and Type | Field and Description |
|---|---|
private boolean |
aborted |
private BinaryProcedure<T,GraphVisitor<T>> |
callee |
private java.util.LinkedList<T> |
enqueued |
private java.util.LinkedList<T> |
pending |
private java.util.Collection<? extends T> |
start |
private java.util.Set<T> |
visited |
| Constructor and Description |
|---|
GraphVisitorDFS(java.util.Collection<? extends T> first,
BinaryProcedure<T,GraphVisitor<T>> callee) |
GraphVisitorDFS(T first,
BinaryProcedure<T,GraphVisitor<T>> callee) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
enqueue(java.util.Collection<? extends T> next) |
void |
enqueue(T next) |
java.util.Collection<T> |
getVisitedNodes() |
void |
process() |
boolean |
wasAborted() |
private final java.util.Collection<? extends T> start
private final java.util.Set<T> visited
private final BinaryProcedure<T,GraphVisitor<T>> callee
private final java.util.LinkedList<T> pending
private final java.util.LinkedList<T> enqueued
private boolean aborted
public GraphVisitorDFS(T first, BinaryProcedure<T,GraphVisitor<T>> callee)
public GraphVisitorDFS(java.util.Collection<? extends T> first, BinaryProcedure<T,GraphVisitor<T>> callee)
public void enqueue(T next)
enqueue in interface GraphVisitor<T>public void enqueue(java.util.Collection<? extends T> next)
enqueue in interface GraphVisitor<T>public void abort()
abort in interface GraphVisitor<T>public boolean wasAborted()
wasAborted in interface GraphVisitor<T>public java.util.Collection<T> getVisitedNodes()
getVisitedNodes in interface GraphVisitor<T>public void process()
process in interface GraphVisitor<T>