com.tensegrity.graph.model
Class GraphModelFactory

java.lang.Object
  extended bycom.tensegrity.graph.model.GraphModelFactory

public abstract class GraphModelFactory
extends java.lang.Object

This class and its abstract methods represent the interface to factories that are responsible for creating Graph model elements.

You may not create instances of a GraphModelFactory directly. Rather you must instantiate a concrete class derived from this one, best done by calling the static method newInstance found in this class. Our implementation returns a global instance that can be shared by multiple clients.

This class provides several static helper methods that create default model elements. You must pass in a GraphModelFactory instance to do so, however.

Instances of this class that are dereferenced will be garbage collected.

This class depends on concrete, derived classes which can be instantiated.

Version:
$Id: GraphModelFactory.java,v 1.30 2005/09/29 13:45:56 MichaelKegel Exp $
Author:
M. Kegel, Stepan Rutz
See Also:
Graph, Node, Edge, Port, PortDenotation, Subgraph, NodeInfo, EdgeInfo

Constructor Summary
GraphModelFactory()
          Constructs a default instance of GraphModelFactory
 
Method Summary
static Node makeDefaultNode(GraphModelFactory factory, java.lang.String label)
          Creates a new Node using the given GraphModelFactory instance and the given name.
static Node makeDefaultNode(GraphModelFactory factory, java.lang.String label, NodeInfo info)
          Utility method that creates a default node.
abstract  Edge newEdge(Node source, Node target)
          Constructs and returns an Edge object.
abstract  Edge newEdge(Node source, Node target, EdgeInfo info)
          Constructs and returns an Edge object.
abstract  Graph newGraph()
          Constructs and returns a Graph object.
static GraphModelFactory newInstance()
          This method returns a shared instance of the actual GraphModelFactory implementation.
abstract  Node newNode(java.lang.String label, java.util.List ports)
          Creates a new Node object with the specified name.
abstract  Node newNode(java.lang.String label, java.util.List ports, NodeInfo info)
          Constructs and returns a node object.
abstract  Port newPort(PortDenotation denotation)
          Constructs and returns a new Port object.
abstract  PortDenotation newPortDenotation(java.lang.String name)
          Constructs and returns a new PortDenotation object.
abstract  PortDenotation newPortDenotation(java.lang.String name, boolean inputPort, boolean outputPort)
          Constructs and returns a new PortDenotation object.
abstract  PortDenotation newPortDenotation(java.lang.String name, boolean hierarchicalPort, boolean inputPort, boolean outputPort, int inputCardinality, int outputCardinality)
          Constructs and returns a new PortDenotation object.
abstract  PortDenotation newPortDenotation(java.lang.String name, boolean hierarchicalPort, boolean inputPort, boolean outputPort, int inputCardinality, int outputCardinality, int inputAcceptLevel, int outputAcceptLevel)
           
abstract  PortDenotation newPortDenotation(java.lang.String name, boolean inputPort, boolean outputPort, int inputCardinality, int outputCardinality)
          Constructs and returns a new PortDenotation object.
abstract  Subgraph newSubgraph(java.lang.String label, Graph graph)
          Constructs and returns a new Subgraph object.
abstract  Subgraph newSubgraph(java.lang.String label, NodeInfo info, Graph graph)
          Constructs and returns a new Subgraph object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphModelFactory

public GraphModelFactory()
Constructs a default instance of GraphModelFactory

Method Detail

newPortDenotation

public abstract PortDenotation newPortDenotation(java.lang.String name)
Constructs and returns a new PortDenotation object. To get more information about the usage of them please see the documentation of PortDenotation.

Parameters:
name - the name for the PortDenotation
Returns:
the created PortDenotation instance.

Find more information in the class documentation


newPortDenotation

public abstract PortDenotation newPortDenotation(java.lang.String name,
                                                 boolean inputPort,
                                                 boolean outputPort)
Constructs and returns a new PortDenotation object. To get more information about the usage of them please see the documentation of PortDenotation.

Parameters:
name - the name for the PortDenotation
inputPort - set to true if the port allows incoming edges.
outputPort - set to true if the port allows outgoing edges.
Returns:
the created PortDenotation instance.

newPortDenotation

public abstract PortDenotation newPortDenotation(java.lang.String name,
                                                 boolean inputPort,
                                                 boolean outputPort,
                                                 int inputCardinality,
                                                 int outputCardinality)
Constructs and returns a new PortDenotation object. To get more information about the usage of them please see the documentation of PortDenotation.

Parameters:
name - the name for the PortDenotation
inputPort - set to true if the port allows incoming edges
outputPort - set to true if the port allows outgoing edges
inputCardinality - maximum input cardinality, 0 means unlimited
outputCardinality - maximum output cardinality, 0 means unlimited
Returns:
the created PortDenotation instance.

newPortDenotation

public abstract PortDenotation newPortDenotation(java.lang.String name,
                                                 boolean hierarchicalPort,
                                                 boolean inputPort,
                                                 boolean outputPort,
                                                 int inputCardinality,
                                                 int outputCardinality)
Constructs and returns a new PortDenotation object. To get more information about the usage of them please see the documentation of PortDenotation.

Parameters:
name - the name for the PortDenotation
hierarchicalPort - indicates whether this port should be wrapped by a VisualSubgraph or not
inputPort - set to true if the port allows incoming edges
outputPort - set to true if the port allows outgoing edges
inputCardinality - maximum input cardinality, 0 means unlimited
outputCardinality - maximum output cardinality, 0 means unlimited
Returns:
the created PortDenotation instance

newPortDenotation

public abstract PortDenotation newPortDenotation(java.lang.String name,
                                                 boolean hierarchicalPort,
                                                 boolean inputPort,
                                                 boolean outputPort,
                                                 int inputCardinality,
                                                 int outputCardinality,
                                                 int inputAcceptLevel,
                                                 int outputAcceptLevel)

newPort

public abstract Port newPort(PortDenotation denotation)
Constructs and returns a new Port object. To get more information about the meaning and usage of them please see the documentation of Port.

Parameters:
denotation - the PortDenotation to assign to the port
Returns:
Port the newly created Port

Find more information in the class documentation


newNode

public abstract Node newNode(java.lang.String label,
                             java.util.List ports)
Creates a new Node object with the specified name. The Node contains the given Ports.

Parameters:
label - the label string for the node.
ports - a list of ports to assign to the newly created Node.
Returns:
the created node instance.

Find more information in the class documentation


newNode

public abstract Node newNode(java.lang.String label,
                             java.util.List ports,
                             NodeInfo info)
Constructs and returns a node object.

Parameters:
label - the label string for the created Node.
ports - a list of ports to assign to the new Node.
info - the associated NodeInfo-object.
Returns:
the created node instance.

newSubgraph

public abstract Subgraph newSubgraph(java.lang.String label,
                                     Graph graph)
Constructs and returns a new Subgraph object.

Parameters:
label - the label of the node that wraps the subgraph.
graph - the internal contents of the Subgraph given as an instance of Graph.
Returns:
the node that represents the subgraph.

Find more information in the class documentation


newSubgraph

public abstract Subgraph newSubgraph(java.lang.String label,
                                     NodeInfo info,
                                     Graph graph)
Constructs and returns a new Subgraph object.

Parameters:
label - the label of the node that wraps the subgraph.
info - the node info object for the subgraph.
graph - the internal contents of the Subgraph given as an instance of Graph.
Returns:
the node that represents the subgraph.

newEdge

public abstract Edge newEdge(Node source,
                             Node target)
Constructs and returns an Edge object.

Parameters:
source - the source node of the edge.
target - the target node of the edge.
Returns:
the created edge instance.

Find more information in the class documentation


newEdge

public abstract Edge newEdge(Node source,
                             Node target,
                             EdgeInfo info)
Constructs and returns an Edge object.

Parameters:
source - the source node of the edge.
target - the target node of the edge.
info - the associated edge info object.
Returns:
the created edge instance.

newGraph

public abstract Graph newGraph()
Constructs and returns a Graph object.

Returns:
the created Graph instance.

Find more information in the class documentation


makeDefaultNode

public static final Node makeDefaultNode(GraphModelFactory factory,
                                         java.lang.String label)
Creates a new Node using the given GraphModelFactory instance and the given name.

Parameters:
factory - the GraphModelFactory instance to use for instantiating the Node.
label - the label of the Node.
Returns:
the generated Node.

Find more information in the class documentation


makeDefaultNode

public static final Node makeDefaultNode(GraphModelFactory factory,
                                         java.lang.String label,
                                         NodeInfo info)
Utility method that creates a default node.

Parameters:
factory - the GraphModelFactory instance to use for instantiating the Node.
label - the label of the Node.
info - the NodeInfo object to associate with the created Node.
Returns:
the generated Node.

newInstance

public static GraphModelFactory newInstance()
This method returns a shared instance of the actual GraphModelFactory implementation.

Returns:
an instance of class GraphModelFactory.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.