uk.ed.inf.graph.compound
Interface ICompoundEdgeFactory<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>

Type Parameters:
N - the node
E - the edge
All Superinterfaces:
IBasicEdgeFactory<N,E>, IDirectedEdgeFactory<N,E>
All Known Subinterfaces:
ICompoundChildEdgeFactory<N,E>
All Known Implementing Classes:
BaseChildCompoundEdgeFactory, BaseCompoundEdgeFactory, ChildCompoundEdgeFactory, CompoundEdgeFactory

public interface ICompoundEdgeFactory<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>
extends IDirectedEdgeFactory<N,E>

Factory that creates an edge within a particular child graph. It may work out the LCA node that the edge should be added to. the newly created edge will be added to the child graoh returned by getOwningChildGraph().

Author:
smoodie

Method Summary
 boolean canCreateEdge()
          Tests if the edge can be created based on the node pair.
 E createEdge()
          Creates a new directed edge from outNode to inNode which is owned by the childCompoundGraph returned by getOwningChildGraph().
 ICompoundGraph<N,E> getGraph()
          Get the compound graph that owns this factory.
 IChildCompoundGraph<N,E> getOwningChildGraph()
          The child graph that will contain any edges created by this factory.
 
Methods inherited from interface uk.ed.inf.graph.directed.IDirectedEdgeFactory
getCurrentNodePair, setPair
 
Methods inherited from interface uk.ed.inf.graph.basic.IBasicEdgeFactory
isValidNodePair
 

Method Detail

getGraph

ICompoundGraph<N,E> getGraph()
Get the compound graph that owns this factory.

Specified by:
getGraph in interface IBasicEdgeFactory<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>
Returns:
the graph, which cannot be null.

canCreateEdge

boolean canCreateEdge()
Tests if the edge can be created based on the node pair.

Specified by:
canCreateEdge in interface IBasicEdgeFactory<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>
Returns:
true if this is the case, false otherwise.

getOwningChildGraph

IChildCompoundGraph<N,E> getOwningChildGraph()
The child graph that will contain any edges created by this factory.

Returns:
The child graph, cannot be null.
Throws:
java.lang.IllegalStateException - if getPair() == null.

createEdge

E createEdge()
Creates a new directed edge from outNode to inNode which is owned by the childCompoundGraph returned by getOwningChildGraph().

Specified by:
createEdge in interface IBasicEdgeFactory<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>
Returns:
The newly created edge.