public class SpaceEffGraphNode extends Object implements GraphNode
Modifier and Type | Class and Description |
---|---|
static interface |
SpaceEffGraphNode.GraphEdgeEnumeration<T extends GraphEdge> |
(package private) static class |
SpaceEffGraphNode.InEdgeEnumeration |
(package private) static class |
SpaceEffGraphNode.InNodeEnumeration |
static class |
SpaceEffGraphNode.OutEdgeEnumeration |
(package private) static class |
SpaceEffGraphNode.OutNodeEnumeration |
Modifier and Type | Field and Description |
---|---|
protected SpaceEffGraphEdge |
_inEdgeEnd |
protected SpaceEffGraphEdge |
_inEdgeStart |
protected SpaceEffGraphEdge |
_outEdgeEnd |
protected SpaceEffGraphEdge |
_outEdgeStart |
(package private) static int |
DFS_VISITED |
protected int |
info
The following word is used for various purposes.
|
(package private) static int |
INFO_MASK |
(package private) static int |
LOOP_HEADER |
SpaceEffGraphNode |
next
Links inlined from DoublyLinkedListElement.
|
SpaceEffGraphNode |
nextSorted |
(package private) static int |
ON_STACK |
SpaceEffGraphNode |
prev
Links inlined from DoublyLinkedListElement.
|
(package private) static int |
TOP_VISITED |
Constructor and Description |
---|
SpaceEffGraphNode() |
protected int info
static final int DFS_VISITED
static final int TOP_VISITED
static final int ON_STACK
static final int LOOP_HEADER
static final int INFO_MASK
public SpaceEffGraphNode nextSorted
protected SpaceEffGraphEdge _outEdgeStart
protected SpaceEffGraphEdge _outEdgeEnd
protected SpaceEffGraphEdge _inEdgeStart
protected SpaceEffGraphEdge _inEdgeEnd
public SpaceEffGraphNode prev
public SpaceEffGraphNode next
public SpaceEffGraphNode()
public final boolean dfsVisited()
public final boolean topVisited()
public final boolean onStack()
public final boolean flagsOn()
public final boolean isLoopHeader()
public final void setDfsVisited()
public final void setTopVisited()
public final void setOnStack()
public final void setDfsVisitedOnStack()
public final void setLoopHeader()
public final void clearDfsVisited()
public final void clearTopVisited()
public final void clearOnStack()
public final void clearFlags()
public final void clearLoopHeader()
public final void setNumber(int value)
public final int getNumber()
public final int getIndex()
GraphNode
Graph.compactNodeNumbering
the nodes of a graph should be
numbered 0 thru (# of nodes in graph - 1).public final SpaceEffGraphEdge firstInEdge()
public final SpaceEffGraphEdge firstOutEdge()
public final SpaceEffGraphNode firstInNode()
public final SpaceEffGraphNode firstOutNode()
final void clearIn()
final void clearOut()
public final void deleteIn()
public final void deleteOut()
public final int getNumberOfIn()
public final int getNumberOfOut()
public final boolean hasZeroOut()
public final boolean hasZeroIn()
public final boolean hasOneOut()
public final boolean hasOneIn()
public final boolean pointsIn(SpaceEffGraphNode inNode)
public final boolean pointsOut(SpaceEffGraphNode outNode)
public final SpaceEffGraphEdge findOutEdgeTo(SpaceEffGraphNode n)
public final void replaceInEdge(SpaceEffGraphEdge e1, SpaceEffGraphEdge e2)
e1
- original edgee2
- new edge
TODO YUCK: this data structure is messy. I assume this is in the name
of efficiency, but it makes control flow graph manipulations
a real pain. (SJF)public final boolean hasOneIn(SpaceEffGraphNode inNode)
inNode
- the node that might be the single predecessortrue
if the node is the single predecessor of this nodepublic final boolean hasOneOut(SpaceEffGraphNode outNode)
outNode
- the node that might be the single successortrue
if the node is the single successor of this nodepublic final void replaceOut(SpaceEffGraphNode oldOut, SpaceEffGraphNode newOut)
public final void insertOut(SpaceEffGraphNode to, SpaceEffGraphEdge e)
public final void insertOut(SpaceEffGraphNode to)
public final void deleteOut(SpaceEffGraphNode node)
public final void deleteOut(SpaceEffGraphEdge e)
public final void sortDFS()
protected final void _sortDFS(SpaceEffGraphNode header)
public final void clearOutFlags()
public final void clearInFlags()
public final void sortTop()
protected final SpaceEffGraphNode _sortTop(SpaceEffGraphNode tail)
public final void sortRevTop()
protected final SpaceEffGraphNode _sortRevTop(SpaceEffGraphNode tail)
final void printSorted()
final void revertOuts()
public final SpaceEffGraphNode.InEdgeEnumeration inEdges()
public final SpaceEffGraphNode.OutEdgeEnumeration outEdges()
public final Enumeration<GraphNode> inNodes()
GraphNode
public final Enumeration<GraphNode> outNodes()
GraphNode
public void printInEdges()
public void printOutEdges()
public void printInNodes()
public void printOutNodes()
public void printExtended()
protected final void appendInEdge(SpaceEffGraphEdge e)
protected final void appendOutEdge(SpaceEffGraphEdge e)
protected final void removeIn(SpaceEffGraphEdge InEdge)
protected final SpaceEffGraphEdge removeIn(SpaceEffGraphNode InNode)
protected final void removeOut(SpaceEffGraphEdge OutEdge)
protected final SpaceEffGraphEdge removeOut(SpaceEffGraphNode OutNode)
public final SpaceEffGraphNode getNext()
public final SpaceEffGraphNode getPrev()
public final void append(SpaceEffGraphNode n)
n
- the node to appendpublic final SpaceEffGraphNode remove()