uk.ed.inf.graph.compound.base
Class BaseSubCompoundGraphFactory

java.lang.Object
  extended by uk.ed.inf.graph.compound.base.BaseSubCompoundGraphFactory
All Implemented Interfaces:
IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>, ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>
Direct Known Subclasses:
SubCompoundGraphFactory

public abstract class BaseSubCompoundGraphFactory
extends java.lang.Object
implements ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>


Constructor Summary
protected BaseSubCompoundGraphFactory(BaseSubCompoundGraphBuilder builder)
           
 
Method Summary
 void addEdge(BaseCompoundEdge edge)
          Add an edge to the factory to be used to compose the subgraph.
 void addNode(BaseCompoundNode node)
          Add a node to the factory that will be used to compose the subgraph.
 BaseSubCompoundGraph createInducedSubgraph()
          Creates an induced subgraph that contains all incident edges between the nodes in this graph.
 BaseSubCompoundGraph createPermissiveInducedSubgraph()
           
 BaseSubCompoundGraph createSubgraph()
          Creates a subgraph that includes dangling edges and contains nodes from the compound graphs of of each subgraph.
 java.util.Iterator<BaseCompoundEdge> edgeIterator()
          Get an iterator of the set of edges added to this factory.
 BaseCompoundGraph getGraph()
          The graph that this factory will create a subgraph for.
 java.util.Iterator<BaseCompoundNode> nodeIterator()
          Get an iterator for the set of nodes added to this factory.
 int numEdges()
          The number of edges added to the factory.
 int numNodes()
          Get the number of nodes added to the factory;
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseSubCompoundGraphFactory

protected BaseSubCompoundGraphFactory(BaseSubCompoundGraphBuilder builder)
Method Detail

addNode

public final void addNode(BaseCompoundNode node)
Description copied from interface: IBasicSubgraphFactory
Add a node to the factory that will be used to compose the subgraph.

Specified by:
addNode in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Parameters:
node - The node to be added. Cannot be null.

addEdge

public final void addEdge(BaseCompoundEdge edge)
Description copied from interface: IBasicSubgraphFactory
Add an edge to the factory to be used to compose the subgraph.

Specified by:
addEdge in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>

nodeIterator

public java.util.Iterator<BaseCompoundNode> nodeIterator()
Get an iterator for the set of nodes added to this factory. It will node contain any addition nodes in child compound graphs of these nodes. You should create the subgraph to get this.

Specified by:
nodeIterator in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
iterator of CiNodes.

numNodes

public int numNodes()
Description copied from interface: IBasicSubgraphFactory
Get the number of nodes added to the factory;

Specified by:
numNodes in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the number of nodes.

edgeIterator

public java.util.Iterator<BaseCompoundEdge> edgeIterator()
Get an iterator of the set of edges added to this factory. It will not return any incident edges derived from the nodes selected here or between nodes in any child compound graphs of the selected nodes. You should create the subgraph to get this.

Specified by:
edgeIterator in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the edge iterator that cannot be null.

numEdges

public int numEdges()
Description copied from interface: IBasicSubgraphFactory
The number of edges added to the factory.

Specified by:
numEdges in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the number of edges.

createSubgraph

public BaseSubCompoundGraph createSubgraph()
Creates a subgraph that includes dangling edges and contains nodes from the compound graphs of of each subgraph.

Specified by:
createSubgraph in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
createSubgraph in interface ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the newly created subgraph, cannot be null.

createInducedSubgraph

public BaseSubCompoundGraph createInducedSubgraph()
Creates an induced subgraph that contains all incident edges between the nodes in this graph. Child nodes in the compound-graph of each node are also included. Unattached (dangling) edges defined in the factory are omitted from this sub-graph.

Postcondition: retVal.isInducedSubgraph() == true

Specified by:
createInducedSubgraph in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
createInducedSubgraph in interface ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the newly created induced subgraph.

createPermissiveInducedSubgraph

public BaseSubCompoundGraph createPermissiveInducedSubgraph()
Specified by:
createPermissiveInducedSubgraph in interface ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>

getGraph

public final BaseCompoundGraph getGraph()
Description copied from interface: IBasicSubgraphFactory
The graph that this factory will create a subgraph for.

Specified by:
getGraph in interface IBasicSubgraphFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
getGraph in interface ISubCompoundGraphFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the owning graph, which cannot be null.