joeq.Compiler.Dataflow
Class SortedSetSolver

java.lang.Object
  extended by joeq.Compiler.Dataflow.Solver
      extended by joeq.Compiler.Dataflow.WorklistSolver
          extended by joeq.Compiler.Dataflow.SortedSetSolver

public class SortedSetSolver
extends WorklistSolver

SortedSetSolver

Version:
$Id: SortedSetSolver.java 1931 2004-09-22 22:17:47Z joewhaley $
Author:
John Whaley

Field Summary
protected  List allNodes
          All locations in the graph, stored in a list.
protected  Comparator ordering
          Location ordering function.
protected  SortedSet worklist
          Worklist of locations, sorted by priority.
 
Fields inherited from class joeq.Compiler.Dataflow.WorklistSolver
boundaries, graphNavigator
 
Fields inherited from class joeq.Compiler.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
SortedSetSolver()
           
SortedSetSolver(Comparator c)
           
SortedSetSolver(jwutil.collections.MapFactory f)
           
 
Method Summary
 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, jwutil.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  Object pull()
          Pull the next location off of the worklist.
protected  void pushAll(Collection c)
          Push all of the given locations onto the worklist.
 void setOrder(Comparator c)
          Set the default ordering for this solver.
 
Methods inherited from class joeq.Compiler.Dataflow.WorklistSolver
boundaryLocations, getPredecessors, getSuccessors, solve
 
Methods inherited from class joeq.Compiler.Dataflow.Solver
compareResults, direction, dumpResults, 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 List allNodes
All locations in the graph, stored in a list.


worklist

protected SortedSet worklist
Worklist of locations, sorted by priority.


ordering

protected Comparator ordering
Location ordering function.

Constructor Detail

SortedSetSolver

public SortedSetSolver(jwutil.collections.MapFactory f)

SortedSetSolver

public SortedSetSolver()

SortedSetSolver

public SortedSetSolver(Comparator c)
Method Detail

setOrder

public void setOrder(Comparator c)
Set the default ordering for this solver.

Parameters:
c - comparator object that implements the ordering

initialize

public void initialize(Problem p,
                       jwutil.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 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 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(Collection c)
Description copied from class: WorklistSolver
Push all of the given locations onto the worklist.

Specified by:
pushAll in class WorklistSolver


Copyright © 2001-2008 John Whaley. All Rights Reserved.