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

Quick Search    Search Deep

Compil3r.Dataflow
Class PriorityQueueSolver  view PriorityQueueSolver download PriorityQueueSolver.java

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

public class PriorityQueueSolver
extends WorklistSolver

PriorityQueueSolver

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

Field Summary
protected  java.util.Map nodesToPriorities
          Map from nodes to their (integer) priorities.
protected  Util.Collections.MaxPriorityQueue worklist
          Priority-queue implementation of the worklist.
 
Fields inherited from class Compil3r.Dataflow.WorklistSolver
boundaries, graphNavigator
 
Fields inherited from class Compil3r.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
PriorityQueueSolver()
           
PriorityQueueSolver(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.
 void initialize(Problem p, Util.Graphs.Graph graph, java.util.List traversalOrder)
          Initializes this solver with the given dataflow problem, graph, and traversal order.
protected  void initializeTraversalOrder(java.util.List order)
           
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.
 
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

nodesToPriorities

protected java.util.Map nodesToPriorities
Map from nodes to their (integer) priorities.


worklist

protected Util.Collections.MaxPriorityQueue worklist
Priority-queue implementation of the worklist.

Constructor Detail

PriorityQueueSolver

public PriorityQueueSolver(Util.Collections.MapFactory f)

PriorityQueueSolver

public PriorityQueueSolver()
Method Detail

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

initialize

public void initialize(Problem p,
                       Util.Graphs.Graph graph,
                       java.util.List traversalOrder)
Initializes this solver with the given dataflow problem, graph, and traversal order.


initializeTraversalOrder

protected void initializeTraversalOrder(java.util.List order)

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