|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.backend.Node
public abstract class Node
This is an abstract class which represents a node in a graph.
$Id: Node.java,v 1.10 2007-10-31 16:39:16 bmaher Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary | |
---|---|
protected int |
color
|
protected int |
label
|
protected Vector<Node> |
predecessors
|
protected Vector<Node> |
successors
|
protected int |
tag
|
Constructor Summary | |
---|---|
Node(int label)
The default constructor. |
Method Summary | |
---|---|
void |
addInEdge(Node in)
Add an incoming edge. |
void |
addOutEdge(Node out)
Add an out going edge. |
void |
deleteInEdge(Node in)
Delete an incoming edge. |
void |
deleteOutEdge(Node out)
Delete an outgoing edge. |
Node |
getInEdge(int i)
Return the i-th predecessor node. |
Vector<Node> |
getInEdges()
Return an array containing all predecessors. |
int |
getLabel()
Return the unique identifier for this block. |
Node |
getOutEdge(int i)
Return the i-th successor node. |
Vector<Node> |
getOutEdges()
Return an array containing all successors. |
int |
getTag()
Get the tag for the block. |
int |
indexOfInEdge(Node in)
Return the index of the specified in-coming CFG edge. |
int |
indexOfOutEdge(Node out)
Return the index of the specified out-going CFG edge. |
protected abstract void |
nextVisit()
The next unique color for traversing the graph. |
int |
numInEdges()
Return the number of in-coming edges. |
int |
numOutEdges()
Return the number of out-going edges. |
void |
pushInEdges(Stack<Node> wl)
Add the predecessors of this block to the stack if they haven't been visited before. |
void |
pushInEdges(Stack<Node> wl,
HashSet<Node> visited)
Add the predecessors of this block to the stack if they haven't been visited before. |
void |
pushOutEdges(Stack<Node> wl)
Add the successors of this block to the stack if they haven't been visited before. |
void |
pushOutEdges(Stack<Node> wl,
HashSet<java.lang.Object> visited)
Add the successors of this block to the stack if they haven't been visited before. |
void |
replaceInEdge(Node oldEdge,
Node newEdge)
Replace the existing incoming edge with a new edge. |
void |
replaceOutEdge(Node oldEdge,
Node newEdge)
Replace the existing outgoing edge with a new edge. |
void |
setLabel(int label)
Set the unique identifier for this block. |
void |
setTag(int tag)
Set the tag for the block. |
protected abstract void |
setVisited()
Mark that the block has been visited. |
void |
unlink()
Remove this node from the graph. |
abstract boolean |
visited()
Return true if the block has been visited. |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayColorHint, getDisplayLabel, getDisplayName, getDisplayShapeHint, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toString, toStringAnnotations, toStringClass, toStringSpecial, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface scale.common.DisplayNode |
---|
getDisplayColorHint, getDisplayLabel, getDisplayName, getDisplayShapeHint |
Field Detail |
---|
protected Vector<Node> successors
protected Vector<Node> predecessors
protected int color
protected int label
protected int tag
Constructor Detail |
---|
public Node(int label)
Method Detail |
---|
public final void pushInEdges(Stack<Node> wl)
public final void pushInEdges(Stack<Node> wl, HashSet<Node> visited)
wl
- the stackvisited
- the set of visited nodespublic final void pushOutEdges(Stack<Node> wl)
public final void pushOutEdges(Stack<Node> wl, HashSet<java.lang.Object> visited)
wl
- the stackvisited
- the set of visited nodespublic final int numInEdges()
public final int numOutEdges()
public final Node getInEdge(int i)
public final Node getOutEdge(int i)
public final Vector<Node> getInEdges()
public final Vector<Node> getOutEdges()
public final int indexOfInEdge(Node in)
public final int indexOfOutEdge(Node out)
public final void replaceInEdge(Node oldEdge, Node newEdge)
public final void replaceOutEdge(Node oldEdge, Node newEdge)
public final void addInEdge(Node in)
public final void addOutEdge(Node out)
public final void deleteOutEdge(Node out)
public final void deleteInEdge(Node in)
public final void unlink()
public final int getLabel()
public final void setLabel(int label)
public final void setTag(int tag)
public final int getTag()
protected abstract void setVisited()
public abstract boolean visited()
protected abstract void nextVisit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |