harpoon.IR.Quads
Class Edge

java.lang.Object
  extended by harpoon.IR.Properties.CFGEdge<Quad,Edge>
      extended by harpoon.IR.Quads.Edge
All Implemented Interfaces:
HCodeEdge<Quad>, Graph.Edge<Quad,Edge>, Serializable

public class Edge
extends CFGEdge<Quad,Edge>
implements Serializable

Edge objects connect Quad nodes in the control-flow graph. The hashCode and equals methods of Edge have been implemented so that Edges can be used as hash table keys to associate analysis data with control-flow edges.

Version:
$Id: Edge.java,v 1.6 2003/05/09 16:35:32 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Field Summary
static ArrayFactory<Edge> arrayFactory
          Array factory: returns new Edge[].
 
Method Summary
 boolean equals(Object obj)
          Compares two Edges for equality.
 Quad from()
          Returns the source vertex of this Edge.
 int hashCode()
          Returns a hash code value for this object.
 Quad to()
          Returns the destination vertex of this Edge.
 String toString()
          Returns a human-readable representation of the Edge.
 int which_pred()
          Returns the predecessor index of this Edge in to.
 int which_succ()
          Returns the successor index of this Edge in from.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

arrayFactory

public static final ArrayFactory<Edge> arrayFactory
Array factory: returns new Edge[].

Method Detail

from

public Quad from()
Returns the source vertex of this Edge.

Specified by:
from in interface HCodeEdge<Quad>
Specified by:
from in interface Graph.Edge<Quad,Edge>
Specified by:
from in class CFGEdge<Quad,Edge>

to

public Quad to()
Returns the destination vertex of this Edge.

Specified by:
to in interface HCodeEdge<Quad>
Specified by:
to in interface Graph.Edge<Quad,Edge>
Specified by:
to in class CFGEdge<Quad,Edge>

which_pred

public int which_pred()
Returns the predecessor index of this Edge in to. this.to().prevEdge(this.which_pred()) == this.


which_succ

public int which_succ()
Returns the successor index of this Edge in from. this.from().nextEdge(this.which_succ()) == this.


equals

public boolean equals(Object obj)
Compares two Edges for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object

toString

public String toString()
Returns a human-readable representation of the Edge.

Overrides:
toString in class Object