Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Compil3r.Dataflow
Class WorklistSolver  view WorklistSolver download WorklistSolver.java

java.lang.Object
  extended byCompil3r.Dataflow.Solver
      extended byCompil3r.Dataflow.WorklistSolver
Direct Known Subclasses:
PriorityQueueSolver, SortedSetSolver

public abstract class WorklistSolver
extends Solver

WorklistSolver

Version:
$Id: WorklistSolver.java,v 1.1 2003/06/17 02:37:51 joewhaley Exp $

Field Summary
protected  java.util.Collection boundaries
          The boundary locations.
protected  Util.Graphs.Navigator graphNavigator
          Navigator to navigate the graph of locations.
 
Fields inherited from class Compil3r.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
protected WorklistSolver()
           
protected WorklistSolver(Util.Collections.MapFactory f)
           
 
Method Summary
 java.util.Iterator boundaryLocations()
          Returns an iteration of all boundary locations.
protected  java.util.Collection getPredecessors(java.lang.Object c)
          Get the predecessor locations of the given location.
protected  java.util.Collection getSuccessors(java.lang.Object c)
          Get the successor locations of the given location.
protected abstract  boolean hasNext()
          Returns true if the worklist is not empty, false otherwise.
 void initialize(Problem p, Util.Graphs.Graph graph)
          Initializes the solver to prepare to solve the dataflow problem on the given graph.
protected abstract  void initializeWorklist()
          (Re-)initialize the worklist.
protected abstract  java.lang.Object pull()
          Pull the next location off of the worklist.
protected abstract  void pushAll(java.util.Collection c)
          Push all of the given locations onto the worklist.
 void solve()
          Solves this dataflow problem.
 
Methods inherited from class Compil3r.Dataflow.Solver
allLocations, direction, getDataflowValue, initializeDataflowValueMap, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphNavigator

protected Util.Graphs.Navigator graphNavigator
Navigator to navigate the graph of locations.


boundaries

protected java.util.Collection boundaries
The boundary locations.

Constructor Detail

WorklistSolver

protected WorklistSolver(Util.Collections.MapFactory f)

WorklistSolver

protected WorklistSolver()
Method Detail

getPredecessors

protected java.util.Collection getPredecessors(java.lang.Object c)
Get the predecessor locations of the given location.


getSuccessors

protected java.util.Collection getSuccessors(java.lang.Object c)
Get the successor locations of the given location.


initializeWorklist

protected abstract void initializeWorklist()
(Re-)initialize the worklist.


hasNext

protected abstract boolean hasNext()
Returns true if the worklist is not empty, false otherwise.


pull

protected abstract java.lang.Object pull()
Pull the next location off of the worklist.


pushAll

protected abstract void pushAll(java.util.Collection c)
Push all of the given locations onto the worklist.


boundaryLocations

public java.util.Iterator boundaryLocations()
Description copied from class: Solver
Returns an iteration of all boundary locations.

Specified by:
boundaryLocations in class Solver

initialize

public void initialize(Problem p,
                       Util.Graphs.Graph graph)
Description copied from class: Solver
Initializes the solver to prepare to solve the dataflow problem on the given graph.

Overrides:
initialize in class Solver

solve

public void solve()
Description copied from class: Solver
Solves this dataflow problem.

Specified by:
solve in class Solver