org.jikesrvm.compilers.opt.util
Class SpaceEffGraphEdge

java.lang.Object
  extended by org.jikesrvm.compilers.opt.util.SpaceEffGraphEdge
All Implemented Interfaces:
GraphEdge
Direct Known Subclasses:
CoalesceGraph.Edge, DepGraphEdge, ValueGraphEdge

public class SpaceEffGraphEdge
extends Object
implements GraphEdge

SpaceEffGraphEdge is a generic graph edge. Extend this to implement specific graph edge types, or use it as a generic edge. SpaceEffGraphEdges are directed, and therefore, have a from-node and a to-node.


Field Summary
protected  SpaceEffGraphNode _fromNode
          Start node.
protected  SpaceEffGraphNode _toNode
          End node.
(package private) static int BACK_EDGE
           
(package private) static int DOMINATOR
           
(package private) static int INFO_MASK
           
protected  SpaceEffGraphEdge nextIn
          Links inlined from LinkedListElement2.
protected  SpaceEffGraphEdge nextOut
          Links inlined from LinkedListElement2.
protected  int scratch
          The following word is defined for several uses.
(package private) static int VISITED
           
 
Constructor Summary
(package private) SpaceEffGraphEdge()
          Constructs an empty edge.
protected SpaceEffGraphEdge(SpaceEffGraphNode fromNode, SpaceEffGraphNode toNode)
          Constructs an edge starting at a given node and ending at a given node.
 
Method Summary
(package private)  void appendIn(SpaceEffGraphEdge e)
          Append a given edge after this edge as an in edge.
(package private)  void appendOut(SpaceEffGraphEdge e)
          Append a given edge after this edge as an out edge.
 boolean backEdge()
           
 void clearBackEdge()
           
 void clearDominatorEdge()
           
 void clearVisited()
           
(package private)  void delete()
          Delete this edge from the graph.
 boolean dominatorEdge()
           
 GraphNode from()
          Get the start node for the edge.
 SpaceEffGraphNode fromNode()
          Get the start node for the edge.
 String fromNodeString()
          Returns the string representation of the start node (used for printing).
 int getInfo()
           
 SpaceEffGraphEdge getNextIn()
          Get the next in edge.
 SpaceEffGraphEdge getNextOut()
          Get the next out edge.
 String getTypeString()
          Returns the string representation of the edge type.
 void setBackEdge()
           
 void setDominatorEdge()
           
(package private)  void setFromNode(SpaceEffGraphNode fromNode)
          Set start node.
 void setInfo(int value)
           
(package private)  void setToNode(SpaceEffGraphNode toNode)
          Set end node.
 void setVisited()
           
 GraphNode to()
          Get the end node for the edge.
 SpaceEffGraphNode toNode()
          Get the end node for the edge.
 String toNodeString()
          Returns the string representation of the end node (used for printing).
 boolean visited()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_toNode

protected SpaceEffGraphNode _toNode
End node.


_fromNode

protected SpaceEffGraphNode _fromNode
Start node.


scratch

protected int scratch
The following word is defined for several uses. The first 4 bits are reserved for SpaceEffGraph. Classes that subclass this one can use the remaining 28 bits


VISITED

static final int VISITED
See Also:
Constant Field Values

BACK_EDGE

static final int BACK_EDGE
See Also:
Constant Field Values

DOMINATOR

static final int DOMINATOR
See Also:
Constant Field Values

INFO_MASK

static final int INFO_MASK
See Also:
Constant Field Values

nextIn

protected SpaceEffGraphEdge nextIn
Links inlined from LinkedListElement2.


nextOut

protected SpaceEffGraphEdge nextOut
Links inlined from LinkedListElement2.

Constructor Detail

SpaceEffGraphEdge

SpaceEffGraphEdge()
Constructs an empty edge.


SpaceEffGraphEdge

protected SpaceEffGraphEdge(SpaceEffGraphNode fromNode,
                            SpaceEffGraphNode toNode)
Constructs an edge starting at a given node and ending at a given node.

Parameters:
fromNode - start node
toNode - end node
Method Detail

visited

public final boolean visited()

backEdge

public final boolean backEdge()

dominatorEdge

public final boolean dominatorEdge()

setVisited

public final void setVisited()

setBackEdge

public final void setBackEdge()

setDominatorEdge

public final void setDominatorEdge()

clearVisited

public final void clearVisited()

clearBackEdge

public final void clearBackEdge()

clearDominatorEdge

public final void clearDominatorEdge()

getInfo

public final int getInfo()

setInfo

public final void setInfo(int value)

toNode

public final SpaceEffGraphNode toNode()
Get the end node for the edge.

Returns:
end node for the edge

fromNode

public final SpaceEffGraphNode fromNode()
Get the start node for the edge.

Returns:
start node for the edge

setToNode

final void setToNode(SpaceEffGraphNode toNode)
Set end node. WARNING: use with caution

Parameters:
toNode - new end node

setFromNode

final void setFromNode(SpaceEffGraphNode fromNode)
Set start node. WARNING: use with caution

Parameters:
fromNode - new start node

delete

final void delete()
Delete this edge from the graph.


getTypeString

public String getTypeString()
Returns the string representation of the edge type.

Returns:
string representation of the edge type

toNodeString

public String toNodeString()
Returns the string representation of the end node (used for printing).

Returns:
string representation of the end node

fromNodeString

public String fromNodeString()
Returns the string representation of the start node (used for printing).

Returns:
string representation of the start node

to

public final GraphNode to()
Get the end node for the edge.

Specified by:
to in interface GraphEdge
Returns:
end node for the edge

from

public final GraphNode from()
Get the start node for the edge.

Specified by:
from in interface GraphEdge
Returns:
start node for the edge

getNextIn

public final SpaceEffGraphEdge getNextIn()
Get the next in edge.

Returns:
next in edge.

getNextOut

public final SpaceEffGraphEdge getNextOut()
Get the next out edge.

Returns:
next out edge.

appendIn

final void appendIn(SpaceEffGraphEdge e)
Append a given edge after this edge as an in edge.

Parameters:
e - the edge to append

appendOut

final void appendOut(SpaceEffGraphEdge e)
Append a given edge after this edge as an out edge.

Parameters:
e - the edge to append