org.jikesrvm.compilers.opt.util

## Interface Graph

• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` ```addGraphEdge(GraphNode source, GraphNode target)```
Add a new edge to a graph.
`void` `addGraphNode(GraphNode node)`
Add a new graph node to the graph.
`void` `compactNodeNumbering()`
After this method is called, all nodes in the graph should have a compact numbering from 0 to (number of nodes in graph - 1).
`Enumeration<GraphNode>` `enumerateNodes()`
This method lists all of the nodes in a given graph.
`int` `numberOfNodes()`
Find out how many nodes are in the graph
• ### Method Detail

• #### enumerateNodes

`Enumeration<GraphNode> enumerateNodes()`
This method lists all of the nodes in a given graph. This is defined in terms of generic GraphNodes.
Returns:
an enumeration of all nodes in the graph
`GraphNode`
• #### numberOfNodes

`int numberOfNodes()`
Find out how many nodes are in the graph
Returns:
the number of nodes in the graph
• #### compactNodeNumbering

`void compactNodeNumbering()`
After this method is called, all nodes in the graph should have a compact numbering from 0 to (number of nodes in graph - 1). This number is what should be returned by `GraphNode.getIndex`. This method is used by clients that want to e.g. allocate look-aside storage for graph nodes in an array.
`void addGraphNode(GraphNode node)`
`node` - the node to add to the graph
```void addGraphEdge(GraphNode source,
`source` - the source node of the edge to add
`target` - the target node of the edge to add