harpoon.Analysis.PA2
Class MapRelPAEdgeSet

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

public class MapRelPAEdgeSet
extends PAEdgeSet

MapRelPAEdgeSet

Version:
$Id: MapRelPAEdgeSet.java,v 1.5 2005/11/30 22:25:56 salcianu Exp $
Author:
Alexandru Salcianu <salcianu@alum.mit.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.Analysis.PA2.PAEdgeSet
PAEdgeSet.EdgeAction
 
Field Summary
 
Fields inherited from class jpaul.Graphs.DiGraph
CACHING
 
Constructor Summary
MapRelPAEdgeSet(jpaul.DataStructs.Factory<Map<PANode,jpaul.DataStructs.Relation<HField,PANode>>> mapFact, jpaul.DataStructs.Factory<jpaul.DataStructs.Relation<HField,PANode>> relFact)
           
 
Method Summary
 Iterable<PANode> allNodes()
           
 Object clone()
          Creates a new, independent set of edges (independent = the operations on the new relation won't affect the old one).
 Collection<HField> fields(PANode n)
           
 jpaul.Graphs.ForwardNavigator<PANode> getForwardNavigator()
           
 boolean join(PAEdgeSet es2)
          Adds all the edges from es2 to this set pf edges.
 Collection<PANode> pointedNodes(PANode n)
           
 Collection<PANode> pointedNodes(PANode n, HField hf)
           
 void print(PrintWriter pw, String indentStr)
           
 Collection<PANode> sources()
           
protected  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 harpoon.Analysis.PA2.PAEdgeSet
addEdge, addEdges, addEdges, forAllEdges, forAllEdges, getRoots, isEmpty, print, print, toString
 
Methods inherited from class jpaul.Graphs.DiGraph
constructBiDiNavigator, dfs, dfs2, diGraph, diGraph, findPath, findPath, forAllVertices, getBiDiNavigator, getComponentDiGraph, 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

MapRelPAEdgeSet

public MapRelPAEdgeSet(jpaul.DataStructs.Factory<Map<PANode,jpaul.DataStructs.Relation<HField,PANode>>> mapFact,
                       jpaul.DataStructs.Factory<jpaul.DataStructs.Relation<HField,PANode>> relFact)
Parameters:
mapFact - Factory that generates the underlying map from nodes to relations between fields and nodes.
relFact - Factory that generates the underlying relations.
Method Detail

uncheckedAddEdge

protected boolean uncheckedAddEdge(PANode n1,
                                   HField hf,
                                   PANode n2)
Description copied from class: PAEdgeSet
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.

Specified by:
uncheckedAddEdge in class PAEdgeSet

pointedNodes

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

pointedNodes

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

sources

public Collection<PANode> sources()
Specified by:
sources in class PAEdgeSet
Returns:
All nodes from which an edge starts.

allNodes

public Iterable<PANode> allNodes()
Specified by:
allNodes in class PAEdgeSet
Returns:
All nodes from this set of edges.

fields

public Collection<HField> fields(PANode n)
Specified by:
fields in class PAEdgeSet
Returns:
All fields that label edges that leave node.

join

public boolean join(PAEdgeSet es2)
Description copied from class: PAEdgeSet
Adds all the edges from es2 to this set pf edges.

Specified by:
join in class PAEdgeSet
Returns:
true if NEW information was added to this set of edges.

clone

public Object clone()
Creates a new, independent set of edges (independent = the operations on the new relation won't affect the old one).

Overrides:
clone in class PAEdgeSet

getForwardNavigator

public jpaul.Graphs.ForwardNavigator<PANode> getForwardNavigator()
Overrides:
getForwardNavigator in class jpaul.Graphs.DiGraph<PANode>

print

public void print(PrintWriter pw,
                  String indentStr)
Overrides:
print in class PAEdgeSet