|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph
An abstract interface for generic graphs; general graph utilities should be defined in terms of this interface and all graph implementations in the system should implement it.
GraphNode
,
GraphEdge
,
GraphUtilities
Method Summary | |
---|---|
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 |
---|
Enumeration<GraphNode> enumerateNodes()
GraphNode
int numberOfNodes()
void compactNodeNumbering()
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 graphvoid addGraphEdge(GraphNode source, GraphNode target)
source
- the source node of the edge to addtarget
- the target node of the edge to add
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |