|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ggtools.grand.graph.GraphImpl
public class GraphImpl
Simple GraphImpl implementation.
| Constructor Summary | |
|---|---|
GraphImpl(java.lang.String graphName)
Creates a new named graph. |
|
| 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. |
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. |
protected GraphElementFactory |
getFactory()
Returns the current element factory creating one if none exists yet. |
java.lang.String |
getName()
Returns the graph's name. |
Node |
getNode(java.lang.String nodeName)
Find a node from its name. |
java.util.Iterator |
getNodes()
Get the nodes contained in the graph. |
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 |
hasNode(java.lang.String nodeName)
Checks if the graph has a node with a specific name. |
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. |
protected void |
unlinkNode(Node node)
Remove all links starting from or ending to the node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphImpl(java.lang.String graphName)
graphName - name for the new graph.| Method Detail |
|---|
public 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.
createLink in interface GraphlinkName - the new link name, can be nullgraphStartNode - start nodeendNode - end node
public Node createNode(java.lang.String nodeName)
throws DuplicateElementException
null and
must be unique within the graph.
createNode in interface GraphnodeName - new node's name
DuplicateElementException - if there is already a node with the same name.
public Node createNode(SubGraph subGraph,
java.lang.String nodeName)
throws DuplicateElementException
Graphnull and must be unique within the subgraph.
createNode in interface GraphsubGraph - the subgraph to place the node in.nodeName - new node's name
DuplicateElementException - if there is already a node with the same name.
public SubGraph createSubGraph(java.lang.String subGraphName)
throws DuplicateElementException
Graphnull and must be unique within the graph.
createSubGraph in interface GraphsubGraphName - new subgraph name.
DuplicateElementException - if a sub graph with the same name already exists in the
graph.public final java.lang.String getName()
getName in interface Graphpublic Node getNode(java.lang.String nodeName)
NodeContainer
getNode in interface NodeContainernodeName - name of the node to find.
public java.util.Iterator getNodes()
NodeContainerIterator.remove()method in order to allow the filters to remove
nodes.
getNodes in interface NodeContainerpublic Node getStartNode()
null will be returned.
getStartNode in interface Graphpublic SubGraph getSubGraph(java.lang.String subGraphName)
Graph
getSubGraph in interface GraphsubGraphName - name of the subgraph to find.
public java.util.Iterator getSubgraphs()
GraphIterator.remove()method in order to allow the filters to remove
nodes.
getSubgraphs in interface Graphpublic boolean hasNode(java.lang.String nodeName)
NodeContainer
hasNode in interface NodeContainernodeName - node to search.
nodeName.public boolean hasSubGraph(java.lang.String subGraphName)
Graph
hasSubGraph in interface GraphsubGraphName - subgraph to search.
nodeName.public void setStartNode(Node node)
setStartNode in interface Graphnode - to be marked as the starting node of the graph.protected GraphElementFactory getFactory()
protected void unlinkNode(Node node)
node - node to remove from the links.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||