net.ggtools.grand.graph
Class SimpleGraphElementFactory

java.lang.Object
  extended by net.ggtools.grand.graph.SimpleGraphElementFactory
All Implemented Interfaces:
GraphElementFactory

 class SimpleGraphElementFactory
extends java.lang.Object
implements GraphElementFactory

A basic implementation of GraphElementFactory creating NodeImpl & LinkImpl. Instances of this class are linked to a specific graph.

Author:
Christophe Labouisse

Constructor Summary
SimpleGraphElementFactory(Graph graph)
          Creates a factory instance linked to a specific graph.
 
Method Summary
 Link createLink(java.lang.String linkName, Node startNode, Node endNode)
          Creates a new link between 2 nodes.
 Node createNode(java.lang.String nodeName)
          Creates a new Node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGraphElementFactory

SimpleGraphElementFactory(Graph graph)
Creates a factory instance linked to a specific graph.

Parameters:
graph -
Method Detail

createNode

public Node createNode(java.lang.String nodeName)
Description copied from interface: GraphElementFactory
Creates a new Node.

Specified by:
createNode in interface GraphElementFactory
Parameters:
nodeName - name of the newly created node.
Returns:
a new node.

createLink

public Link createLink(java.lang.String linkName,
                       Node startNode,
                       Node endNode)
Description copied from interface: GraphElementFactory
Creates a new link between 2 nodes.

Specified by:
createLink in interface GraphElementFactory
Parameters:
linkName - the new link name, can be null.
startNode - start node
endNode - end node
Returns:
a new link.


Copyright © 2004-2005 ggTools. All Rights Reserved.