|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Graph
Interface to be implemented by graphs. A Graph is both a container and a factory/manager. As a container a Graph can contain both Nodes and SubGraphs and as a factory it is responsible for the creation and ownership of the contained Nodes or Subgraphs. Although some nodes may be stored in subgraphs, the graph is still the factory/manager for them.
| Method Summary | |
|---|---|
Link |
createLink(java.lang.String linkName,
Node startNode,
Node endNode)
Creates a new link between two nodes. |
Node |
createNode(java.lang.String nodeName)
Creates a new Node in the top level graph. |
Node |
createNode(SubGraph subGraph,
java.lang.String nodeName)
Creates a new Node in a specific graph. |
SubGraph |
createSubGraph(java.lang.String subGraphName)
Creates a new subgraph in the graph. |
java.lang.String |
getName()
Returns the graph's name. |
Node |
getStartNode()
Returns the start node of the graph. |
SubGraph |
getSubGraph(java.lang.String subGraphName)
Find a subgraph from its name. |
java.util.Iterator |
getSubgraphs()
Get the nodes contained in the graph. |
boolean |
hasSubGraph(java.lang.String subGraphName)
Checks if the graph has a subgraph with a specific name. |
void |
setStartNode(Node node)
Sets the graph starting node. |
| Methods inherited from interface net.ggtools.grand.graph.NodeContainer |
|---|
getNode, getNodes, hasNode |
| Method Detail |
|---|
Link createLink(java.lang.String linkName,
Node startNode,
Node endNode)
createNode(String),
this method do not require the link's name to be unique or not null. Both
nodes should be not null.
linkName - the new link name, can be nullstartNode - start nodeendNode - end node
Node createNode(java.lang.String nodeName)
throws DuplicateElementException
null and must be unique within the graph.
nodeName - new node's name
DuplicateElementException - if there is already a node with the same name.
Node createNode(SubGraph subGraph,
java.lang.String nodeName)
throws DuplicateElementException
null and must be unique within the subgraph.
subGraph - the subgraph to place the node in.nodeName - new node's name
DuplicateElementException - if there is already a node with the same name.
SubGraph createSubGraph(java.lang.String subGraphName)
throws DuplicateElementException
null and must be unique within the graph.
subGraphName - new subgraph name.
DuplicateElementException - if a sub graph with the same name already exists in the
graph.java.lang.String getName()
Node getStartNode()
null will be returned.
SubGraph getSubGraph(java.lang.String subGraphName)
subGraphName - name of the subgraph to find.
java.util.Iterator getSubgraphs()
Iterator.remove()method in order to allow the filters to remove
nodes.
boolean hasSubGraph(java.lang.String subGraphName)
subGraphName - subgraph to search.
nodeName.void setStartNode(Node node)
node - the node to declare a the start of the graph.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||