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

Quick Search    Search Deep

Compil3r.Dataflow
Class SortedSetSolver  view SortedSetSolver download SortedSetSolver.java

java.lang.Object
  extended byCompil3r.Dataflow.Solver
      extended byCompil3r.Dataflow.WorklistSolver
          extended byCompil3r.Dataflow.SortedSetSolver

public class SortedSetSolver
extends WorklistSolver

SortedSetSolver

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

Field Summary
protected  java.util.List allNodes
          All locations in the graph, stored in a list.
protected  java.util.Comparator ordering
          Location ordering function.
protected  java.util.SortedSet worklist
          Worklist of locations, sorted by priority.
 
Fields inherited from class Compil3r.Dataflow.WorklistSolver
boundaries, graphNavigator
 
Fields inherited from class Compil3r.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
SortedSetSolver()
           
SortedSetSolver(java.util.Comparator c)
           
SortedSetSolver(Util.Collections.MapFactory f)
           
 
Method Summary
 java.util.Iterator allLocations()
          Returns an iteration of all graph locations.
protected  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  void initializeWorklist()
          (Re-)initialize the worklist.
protected  java.lang.Object pull()
          Pull the next location off of the worklist.
protected  void pushAll(java.util.Collection c)
          Push all of the given locations onto the worklist.
 void setOrder(java.util.Comparator c)
          Set the default ordering for this solver.
 
Methods inherited from class Compil3r.Dataflow.WorklistSolver
boundaryLocations, getPredecessors, getSuccessors, solve
 
Methods inherited from class Compil3r.Dataflow.Solver
direction, getDataflowValue, initializeDataflowValueMap, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allNodes

protected java.util.List allNodes
All locations in the graph, stored in a list.


worklist

protected java.util.SortedSet worklist
Worklist of locations, sorted by priority.


ordering

protected java.util.Comparator ordering
Location ordering function.

Constructor Detail

SortedSetSolver

public SortedSetSolver(Util.Collections.MapFactory f)

SortedSetSolver

public SortedSetSolver()

SortedSetSolver

public SortedSetSolver(java.util.Comparator c)
Method Detail

setOrder

public void setOrder(java.util.Comparator c)
Set the default ordering for this 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 WorklistSolver

allLocations

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

Specified by:
allLocations in class Solver

initializeWorklist

protected void initializeWorklist()
Description copied from class: WorklistSolver
(Re-)initialize the worklist.

Specified by:
initializeWorklist in class WorklistSolver

hasNext

protected boolean hasNext()
Description copied from class: WorklistSolver
Returns true if the worklist is not empty, false otherwise.

Specified by:
hasNext in class WorklistSolver

pull

protected java.lang.Object pull()
Description copied from class: WorklistSolver
Pull the next location off of the worklist.

Specified by:
pull in class WorklistSolver

pushAll

protected void pushAll(java.util.Collection c)
Description copied from class: WorklistSolver
Push all of the given locations onto the worklist.

Specified by:
pushAll in class WorklistSolver