harpoon.Analysis.PA2
Class PAEdgeSet

java.lang.Object
  extended by jpaul.Graphs.DiGraph<PANode>
      extended by harpoon.Analysis.PA2.PAEdgeSet
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MapRelPAEdgeSet

public abstract class PAEdgeSet
extends jpaul.Graphs.DiGraph<PANode>
implements Cloneable

PAEdgeSet

Version:
$Id: PAEdgeSet.java,v 1.2 2005/09/01 22:45:21 salcianu Exp $
Author:
Alexandru Salcianu <salcianu@alum.mit.edu>

Nested Class Summary
static interface PAEdgeSet.EdgeAction
           
 
Field Summary
 
Fields inherited from class jpaul.Graphs.DiGraph
CACHING
 
Constructor Summary
protected PAEdgeSet()
           
 
Method Summary
 boolean addEdge(PANode n1, HField hf, PANode n2)
          Adds an hf-labelled edge between n1 to n2.
 boolean addEdges(Collection<PANode> n1s, HField hf, Collection<PANode> n2s)
           
 boolean addEdges(PANode n1, HField hf, Collection<PANode> n2s)
          Adds an hf-labelled edge between n1 and each node from n2s.
abstract  Iterable<PANode> allNodes()
           
 Object clone()
           
abstract  Collection<HField> fields(PANode node)
           
 void forAllEdges(PAEdgeSet.EdgeAction edgeAction)
           
 void forAllEdges(PANode n, PAEdgeSet.EdgeAction edgeAction)
           
 Collection<PANode> getRoots()
           
 boolean isEmpty()
          Checks whether this set of edges is empty.
abstract  boolean join(PAEdgeSet es2)
          Adds all the edges from es2 to this set pf edges.
abstract  Collection<PANode> pointedNodes(PANode n)
           
abstract  Collection<PANode> pointedNodes(PANode n, HField hf)
           
 void print()
           
 void print(PrintWriter pw, String indentStr)
           
 void print(String identStr)
           
abstract  Collection<PANode> sources()
           
 String toString()
           
protected abstract  boolean uncheckedAddEdge(PANode n1, HField hf, PANode n2)
          Adds an hf-labeled edge between n1 and n2 UNDER ALL CIRCUMSTANCES (regardless of the type filtering, etc.).
 
Methods inherited from class jpaul.Graphs.DiGraph
constructBiDiNavigator, dfs, dfs2, diGraph, diGraph, findPath, findPath, forAllVertices, getBiDiNavigator, getComponentDiGraph, getForwardNavigator, numArcs, numVertices, reverseDiGraph, subDiGraph, transitivePred, transitivePred, transitiveSucc, transitiveSucc, union, vertices
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PAEdgeSet

protected PAEdgeSet()
Method Detail

addEdge

public boolean addEdge(PANode n1,
                       HField hf,
                       PANode n2)
Adds an hf-labelled edge between n1 to n2. Does not add any edge starting in an IMM / CONST / NULL node.


uncheckedAddEdge

protected abstract boolean uncheckedAddEdge(PANode n1,
                                            HField hf,
                                            PANode n2)
Adds an hf-labeled edge between n1 and n2 UNDER ALL CIRCUMSTANCES (regardless of the type filtering, etc.). This method is used internally, while computing the reverse set of edges, in the inter-procedural analysis.


addEdges

public boolean addEdges(PANode n1,
                        HField hf,
                        Collection<PANode> n2s)
Adds an hf-labelled edge between n1 and each node from n2s.

Returns:
true if this is new information.

addEdges

public boolean addEdges(Collection<PANode> n1s,
                        HField hf,
                        Collection<PANode> n2s)

pointedNodes

public abstract Collection<PANode> pointedNodes(PANode n)
Returns:
Collection of all nodes pointed to by n, regardless of the field.

pointedNodes

public abstract Collection<PANode> pointedNodes(PANode n,
                                                HField hf)
Returns:
The collection of the nodes pointed to from n1, along hf-labelled edges.

sources

public abstract Collection<PANode> sources()
Returns:
All nodes from which an edge starts.

allNodes

public abstract Iterable<PANode> allNodes()
Returns:
All nodes from this set of edges.

fields

public abstract Collection<HField> fields(PANode node)
Returns:
All fields that label edges that leave node.

isEmpty

public boolean isEmpty()
Checks whether this set of edges is empty.


join

public abstract boolean join(PAEdgeSet es2)
Adds all the edges from es2 to this set pf edges.

Returns:
true if NEW information was added to this set of edges.

clone

public Object clone()
Overrides:
clone in class Object

getRoots

public Collection<PANode> getRoots()
Specified by:
getRoots in class jpaul.Graphs.DiGraph<PANode>

forAllEdges

public void forAllEdges(PANode n,
                        PAEdgeSet.EdgeAction edgeAction)

forAllEdges

public void forAllEdges(PAEdgeSet.EdgeAction edgeAction)

toString

public String toString()
Overrides:
toString in class jpaul.Graphs.DiGraph<PANode>

print

public void print()

print

public void print(String identStr)

print

public void print(PrintWriter pw,
                  String indentStr)