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

java.lang.Object
  extended by uk.ed.inf.graph.compound.base.BaseCompoundNodeFactory
All Implemented Interfaces:
IBasicNodeFactory<BaseCompoundNode,BaseCompoundEdge>, ICompoundNodeFactory<BaseCompoundNode,BaseCompoundEdge>
Direct Known Subclasses:
CompoundNodeFactory

public abstract class BaseCompoundNodeFactory
extends java.lang.Object
implements ICompoundNodeFactory<BaseCompoundNode,BaseCompoundEdge>


Constructor Summary
BaseCompoundNodeFactory()
           
 
Method Summary
 BaseCompoundNode createNode()
           
abstract  BaseCompoundGraph getGraph()
          Get the graph to which this factory acts upon.
abstract  BaseCompoundNode getParentNode()
           
protected abstract  BaseCompoundNode newNode(BaseCompoundNode parent, int nodeIndex)
          Creates the new node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCompoundNodeFactory

public BaseCompoundNodeFactory()
Method Detail

createNode

public BaseCompoundNode createNode()
Specified by:
createNode in interface IBasicNodeFactory<BaseCompoundNode,BaseCompoundEdge>

newNode

protected abstract BaseCompoundNode newNode(BaseCompoundNode parent,
                                            int nodeIndex)
Creates the new node. The node must be correctly created and owned by the ChildCompoundGraph of the parent node.

Parameters:
parent - the parent node the child graph of which this node will be added.
nodeIndex - the new index to use when creating the node.
Returns:
the newly created node which must be valid and correctly formed.

getGraph

public abstract BaseCompoundGraph getGraph()
Description copied from interface: IBasicNodeFactory
Get the graph to which this factory acts upon.

Specified by:
getGraph in interface IBasicNodeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
getGraph in interface ICompoundNodeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
The owning graph, cannot be null.

getParentNode

public abstract BaseCompoundNode getParentNode()
Specified by:
getParentNode in interface ICompoundNodeFactory<BaseCompoundNode,BaseCompoundEdge>