uk.ed.inf.graph.compound.impl
Class CompoundGraph

java.lang.Object
  extended by uk.ed.inf.graph.compound.base.BaseCompoundGraph
      extended by uk.ed.inf.graph.compound.archetypal.ArchetypalCompoundGraph
          extended by uk.ed.inf.graph.compound.impl.CompoundGraph
All Implemented Interfaces:
IBasicGraph<BaseCompoundNode,BaseCompoundEdge>, ICompoundGraph<BaseCompoundNode,BaseCompoundEdge>, IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>, IDirectedGraph<BaseCompoundNode,BaseCompoundEdge>, IRestorableGraph<BaseCompoundNode,BaseCompoundEdge>

public class CompoundGraph
extends ArchetypalCompoundGraph


Constructor Summary
CompoundGraph()
           
CompoundGraph(CompoundGraph otherGraph)
           
 
Method Summary
protected  void createCopyOfRootNode(int newIndexValue, BaseCompoundNode otherRootNode)
           
protected  void createNewRootNode(int newIndex)
           
 CompoundEdgeFactory edgeFactory()
          Gets an edge factory that works out the LCA of two nodes making up the edge and assigns it to the appropriate compound graph.
 CompoundNode getRootNode()
          Get the root node of this graph.
protected  boolean hasPassedAdditionalValidation()
          A hook method that should be used to provide addition validation for the class inheriting from this one.
 CompoundNodeFactory nodeFactory()
          Gets the node factory to add new nodes to the root child graph of this compound graph.
 SubCompoundGraphFactory subgraphFactory()
          Gets a subgraph factory used to create a subgraph of this graph.
 
Methods inherited from class uk.ed.inf.graph.compound.archetypal.ArchetypalCompoundGraph
getEdgeCounter, getNodeCounter, getNodeTree, getRootNodeIndex
 
Methods inherited from class uk.ed.inf.graph.compound.base.BaseCompoundGraph
canCopyHere, canRemoveSubgraph, containsConnection, containsConnection, containsDirectedEdge, containsDirectedEdge, containsEdge, containsEdge, containsNode, containsNode, copyHere, edgeIterator, getCopiedComponents, getCurrentState, getEdge, getNode, getNumEdges, getNumNodes, isValid, nodeIterator, performCopy, removeSubgraph, restoreState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundGraph

public CompoundGraph()

CompoundGraph

public CompoundGraph(CompoundGraph otherGraph)
Method Detail

createNewRootNode

protected void createNewRootNode(int newIndex)
Specified by:
createNewRootNode in class ArchetypalCompoundGraph

getRootNode

public CompoundNode getRootNode()
Description copied from interface: ICompoundGraph
Get the root node of this graph.

Specified by:
getRootNode in interface ICompoundGraph<BaseCompoundNode,BaseCompoundEdge>
Specified by:
getRootNode in class ArchetypalCompoundGraph
Returns:
The root node, which cannot be null.

edgeFactory

public CompoundEdgeFactory edgeFactory()
Description copied from interface: IModifiableCompoundGraph
Gets an edge factory that works out the LCA of two nodes making up the edge and assigns it to the appropriate compound graph. This is more permissive than the edge factory from a ChildCompoundGraph, which requires to to know that the edge belongs in that child graph (i.e. its root node is the LCA of the out and in nodes of the edge).

Specified by:
edgeFactory in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
Specified by:
edgeFactory in class BaseCompoundGraph
Returns:
The edge factory, which cannot be null.

nodeFactory

public CompoundNodeFactory nodeFactory()
Description copied from interface: IModifiableCompoundGraph
Gets the node factory to add new nodes to the root child graph of this compound graph.

Specified by:
nodeFactory in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
Specified by:
nodeFactory in class BaseCompoundGraph
Returns:
the edge factory, which cannot be null.

subgraphFactory

public SubCompoundGraphFactory subgraphFactory()
Description copied from interface: IModifiableCompoundGraph
Gets a subgraph factory used to create a subgraph of this graph.

Specified by:
subgraphFactory in interface IModifiableCompoundGraph<BaseCompoundNode,BaseCompoundEdge>
Specified by:
subgraphFactory in class BaseCompoundGraph
Returns:
a new instance of the subgraph factory.

createCopyOfRootNode

protected void createCopyOfRootNode(int newIndexValue,
                                    BaseCompoundNode otherRootNode)
Specified by:
createCopyOfRootNode in class ArchetypalCompoundGraph

hasPassedAdditionalValidation

protected boolean hasPassedAdditionalValidation()
Description copied from class: BaseCompoundGraph
A hook method that should be used to provide addition validation for the class inheriting from this one.

Specified by:
hasPassedAdditionalValidation in class BaseCompoundGraph
Returns: