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

All Known Implementing Classes:
ArchetypalChildCompoundGraph, BaseChildCompoundGraph, ChildCompoundGraph

public interface IModifiableChildCompoundGraph<N extends ICompoundNode<N,? extends ICompoundEdge<N,?>>,E extends ICompoundEdge<N,E>>


Method Summary
 boolean canCopyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
          Tests whether the subGraph can be copied to this graph.
 boolean canMoveHere(ISubCompoundGraph<? extends N,? extends E> subGraph)
          Tests whether the subGraph can be moved to this graph.
 void copyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
          Copies a subgraph into this graph.
 ICompoundChildEdgeFactory<N,E> edgeFactory()
          Gets the edgeFactory for this class.
 ISubCompoundGraph<N,E> getCopiedComponents()
          Retrieves the nodes and edges created in this graph by the last copy operation.
 ISubCompoundGraph<N,E> getMovedComponents()
          Retrieves the nodes and edges created in this graph by the last copy operation.
 void moveHere(ISubCompoundGraph<? extends N,? extends E> subGraph)
          Moves a subgraph into this graph.
 ICompoundNodeFactory<N,E> nodeFactory()
           
 

Method Detail

nodeFactory

ICompoundNodeFactory<N,E> nodeFactory()

canCopyHere

boolean canCopyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
Tests whether the subGraph can be copied to this graph. To be true the subgraph must be an induced subgraph that is a consistent of the super graph. It must also be not null.

Parameters:
subGraph - the subgraph to test, can be null.
Returns:
true if the subgraph is valid to copy from, false otherwise.

copyHere

void copyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
Copies a subgraph into this graph. Note that the subgraph can be from a different graph or subgraph of this graph, since the structure of the graph is copied not the nodes and edges instances themselves. Note that the subgraph must be valid to be copied.

Parameters:
subGraph - the subgraph to copy

getCopiedComponents

ISubCompoundGraph<N,E> getCopiedComponents()
Retrieves the nodes and edges created in this graph by the last copy operation. The subgraph is not guaranteed to be a consistent snapshot of this graph. If not copy operation has been performed then an empty subset will be returned.

Returns:
the subgraph of copied components, or an empty subset of not copy operation has been perfromed.

edgeFactory

ICompoundChildEdgeFactory<N,E> edgeFactory()
Gets the edgeFactory for this class. This factory is a singleton so this method must always return the same instance of the factory. The factory is the only way that new edges can be added to this graph.

Returns:
The edge factory.

canMoveHere

boolean canMoveHere(ISubCompoundGraph<? extends N,? extends E> subGraph)
Tests whether the subGraph can be moved to this graph. To be true the subgraph must be an induced subgraph that is a consistent of the super graph. It must also be not null and belong to the same graph as this one. The subgraph must also be valid. Also no nodes in the induced sub-graph of subGraph can be children of this child compound graph.

Parameters:
subGraph - the subgraph to test, can be null.
Returns:
true if the subgraph is valid to copy from, false otherwise.

moveHere

void moveHere(ISubCompoundGraph<? extends N,? extends E> subGraph)
Moves a subgraph into this graph. It does this by creating a new set of nodes in this subgraph and removing the nodes defined in subGraph. The new nodes from the move can be found in getMovedComponents() and the removed nodes will be found in subGraph.

Parameters:
subGraph - the subgraph to move.
Throws:
java.lang.IllegalArgumentException - if canMoveHere(subGraph) == false.

getMovedComponents

ISubCompoundGraph<N,E> getMovedComponents()
Retrieves the nodes and edges created in this graph by the last copy operation. The subgraph is not guaranteed to be a consistent snapshot of this graph. If not copy operation has been performed then an empty subset will be returned.

Returns:
the subgraph of copied components, or an empty subset of not copy operation has been perfromed.