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

java.lang.Object
  extended by uk.ed.inf.graph.compound.base.BaseCompoundEdgeFactory
All Implemented Interfaces:
IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>, ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>, IDirectedEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Direct Known Subclasses:
CompoundEdgeFactory

public abstract class BaseCompoundEdgeFactory
extends java.lang.Object
implements ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>


Constructor Summary
BaseCompoundEdgeFactory()
           
 
Method Summary
abstract  boolean canCreateEdge()
          Tests if the edge can be created based on the node pair.
 BaseCompoundEdge createEdge()
          Creates a new directed edge from outNode to inNode which is owned by the childCompoundGraph returned by getOwningChildGraph().
abstract  BaseCompoundNodePair getCurrentNodePair()
          Gets the current node pair.
abstract  BaseCompoundGraph getGraph()
          Get the compound graph that owns this factory.
protected abstract  BaseCompoundNode getInNode()
           
protected abstract  BaseCompoundNode getOutNode()
           
 BaseChildCompoundGraph getOwningChildGraph()
          The child graph that will contain any edges created by this factory.
protected abstract  BaseCompoundEdge newEdge(BaseChildCompoundGraph owningGraph, int nodeIndex, BaseCompoundNode outNode, BaseCompoundNode inNode)
           
abstract  void setPair(BaseCompoundNode outNode, BaseCompoundNode inNode)
          Sets the nodes to be used to create the edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ed.inf.graph.basic.IBasicEdgeFactory
isValidNodePair
 

Constructor Detail

BaseCompoundEdgeFactory

public BaseCompoundEdgeFactory()
Method Detail

setPair

public abstract void setPair(BaseCompoundNode outNode,
                             BaseCompoundNode inNode)
Description copied from interface: IDirectedEdgeFactory
Sets the nodes to be used to create the edge.

Specified by:
setPair in interface IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
setPair in interface IDirectedEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Parameters:
outNode - outNode, cannot be null.
inNode - inNode, cannot be null.

getOutNode

protected abstract BaseCompoundNode getOutNode()

getInNode

protected abstract BaseCompoundNode getInNode()

getCurrentNodePair

public abstract BaseCompoundNodePair getCurrentNodePair()
Description copied from interface: IDirectedEdgeFactory
Gets the current node pair.

Specified by:
getCurrentNodePair in interface IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
getCurrentNodePair in interface IDirectedEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the current node pair, or null if no node pair has been set yet.

getOwningChildGraph

public BaseChildCompoundGraph getOwningChildGraph()
Description copied from interface: ICompoundEdgeFactory
The child graph that will contain any edges created by this factory.

Specified by:
getOwningChildGraph in interface ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
The child graph, cannot be null.

createEdge

public BaseCompoundEdge createEdge()
Description copied from interface: ICompoundEdgeFactory
Creates a new directed edge from outNode to inNode which is owned by the childCompoundGraph returned by getOwningChildGraph().

Specified by:
createEdge in interface IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
createEdge in interface ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
The newly created edge.

newEdge

protected abstract BaseCompoundEdge newEdge(BaseChildCompoundGraph owningGraph,
                                            int nodeIndex,
                                            BaseCompoundNode outNode,
                                            BaseCompoundNode inNode)

getGraph

public abstract BaseCompoundGraph getGraph()
Description copied from interface: ICompoundEdgeFactory
Get the compound graph that owns this factory.

Specified by:
getGraph in interface IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
getGraph in interface ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
the graph, which cannot be null.

canCreateEdge

public abstract boolean canCreateEdge()
Description copied from interface: ICompoundEdgeFactory
Tests if the edge can be created based on the node pair.

Specified by:
canCreateEdge in interface IBasicEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Specified by:
canCreateEdge in interface ICompoundEdgeFactory<BaseCompoundNode,BaseCompoundEdge>
Returns:
true if this is the case, false otherwise.