xflow.common
Class DirectedGraph

java.lang.Object
  extended byxflow.common.DirectedGraph
All Implemented Interfaces:
java.io.Serializable

public class DirectedGraph
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
DirectedGraph()
          Constructor
DirectedGraph(java.lang.String name)
          Creates a new instance of DirectedGraph with name
DirectedGraph(java.lang.String name, int vers)
          Creates a new instance of DirectedGraph with name and version
 
Method Summary
 java.util.List getAllNodes()
           
 java.lang.String getDescription()
           
 Node getEndNode()
           
 int getGraphId()
           
 java.lang.String getName()
           
 Node getNode(int nodeId)
          Gets a node given the node Id
 Node getNode(java.lang.String nodeName)
          Gets a node given the node name
 java.util.List getNodes(java.lang.String nodeType)
           
 Node getRootNode()
          Gets the root node of this graph
 int getVersion()
           
static DirectedGraph loadByGraphId(int gid)
          Retrieves a graph from the Database using graph ID, including all of its nodes.
 void loadDB()
          Retrieves a graph from the Database, including all of its nodes.
 void saveDB()
          Save the graph and all its nodes to the Database.
 void setDescription(java.lang.String d)
           
 void setGraphId(int i)
           
 void setName(java.lang.String n)
           
 void setRootNode(Node node)
          Sets the root node of this graph.
 void setVersion(int v)
           
 java.lang.String toXML()
           
 void validate()
          Validate a DirectedGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectedGraph

public DirectedGraph()
Constructor


DirectedGraph

public DirectedGraph(java.lang.String name)
Creates a new instance of DirectedGraph with name

Parameters:
name - The name of the graph

DirectedGraph

public DirectedGraph(java.lang.String name,
                     int vers)
Creates a new instance of DirectedGraph with name and version

Parameters:
name - The name of the graph
vers - The version of the graph
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String n)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String d)

getVersion

public int getVersion()

setVersion

public void setVersion(int v)

getGraphId

public int getGraphId()

setGraphId

public void setGraphId(int i)

setRootNode

public void setRootNode(Node node)
Sets the root node of this graph.

Parameters:
node - the root node

getRootNode

public Node getRootNode()
Gets the root node of this graph

Returns:
Node, the root node

loadDB

public void loadDB()
            throws XflowException,
                   java.sql.SQLException
Retrieves a graph from the Database, including all of its nodes.

Throws:
XflowException
java.sql.SQLException

loadByGraphId

public static DirectedGraph loadByGraphId(int gid)
                                   throws XflowException
Retrieves a graph from the Database using graph ID, including all of its nodes.

Throws:
XflowException

saveDB

public void saveDB()
            throws java.lang.Exception
Save the graph and all its nodes to the Database.

Throws:
java.lang.Exception

getNode

public Node getNode(int nodeId)
Gets a node given the node Id

Returns:
Node

validate

public void validate()
              throws XflowException
Validate a DirectedGraph

Throws:
XflowException

toXML

public java.lang.String toXML()
                       throws XflowException
Throws:
XflowException

getNode

public Node getNode(java.lang.String nodeName)
Gets a node given the node name

Returns:
Node

getEndNode

public Node getEndNode()

getNodes

public java.util.List getNodes(java.lang.String nodeType)

getAllNodes

public java.util.List getAllNodes()