cmsc433.p4.explorers
Class SequentialExplorer<N extends Node<N,V>,V>

java.lang.Object
  extended by cmsc433.p4.explorers.SequentialExplorer<N,V>
All Implemented Interfaces:
Explorer<N,V>

public class SequentialExplorer<N extends Node<N,V>,V>
extends Object
implements Explorer<N,V>

A simple, sequential explorer.


Constructor Summary
SequentialExplorer()
           
 
Method Summary
static
<N extends Node<N,V>,V>
SequentialExplorer<N,V>
build()
          Provide a static build method, so that the system will infer the correct generic types
 GraphExploration<N,V> explore(N start)
          Explore the graph from the designated start node.
 void setParallelism(int parallelism)
          Set the number of threads the explorer should use when exploring graphs.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialExplorer

public SequentialExplorer()
Method Detail

setParallelism

public void setParallelism(int parallelism)
Description copied from interface: Explorer
Set the number of threads the explorer should use when exploring graphs. Only used by parallel explorers

Specified by:
setParallelism in interface Explorer<N extends Node<N,V>,V>

build

public static <N extends Node<N,V>,V> SequentialExplorer<N,V> build()
Provide a static build method, so that the system will infer the correct generic types


explore

public GraphExploration<N,V> explore(N start)
                                                throws InterruptedException
Description copied from interface: Explorer
Explore the graph from the designated start node. It may return before all computations have completed, but it all computations should have been initiated (e.g., don't postpone performing any computations under a request is made for the value associated with a node). The exploration should call neighbors() and compute() exactly once for each reached node. If interrupted, it should try to cancel the computation and return quickly.

Specified by:
explore in interface Explorer<N extends Node<N,V>,V>
Throws:
InterruptedException