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

All Known Implementing Classes:
ArchetypalCompoundGraph, BaseCompoundGraph, CompoundGraph

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


Method Summary
 boolean canCopyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
          Removes the nodes and edges defined in the subgraph from this graph.
 boolean canRemoveSubgraph(ISubCompoundGraph<? extends N,? extends E> subgraph)
          Tests if subgraph removal will succeed.
 void copyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
          Copies a subgraph into this graph.
 ICompoundEdgeFactory<N,E> 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.
 ISubCompoundGraph<N,E> getCopiedComponents()
          Retrieves the nodes and edges created in this graph by the last copy operation.
 ICompoundNodeFactory<N,E> nodeFactory()
          Gets the node factory to add new nodes to the root child graph of this compound graph.
 ISubCompoundGraphFactory<N,E> subgraphFactory()
          Gets a subgraph factory used to create a subgraph of this graph.
 

Method Detail

nodeFactory

ICompoundNodeFactory<N,E> nodeFactory()
Gets the node factory to add new nodes to the root child graph of this compound graph.

Returns:
the edge factory, which cannot be null.

edgeFactory

ICompoundEdgeFactory<N,E> 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. 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).

Returns:
The edge factory, which cannot be null.

subgraphFactory

ISubCompoundGraphFactory<N,E> subgraphFactory()
Gets a subgraph factory used to create a subgraph of this graph.

Returns:
a new instance of the subgraph factory.

canRemoveSubgraph

boolean canRemoveSubgraph(ISubCompoundGraph<? extends N,? extends E> subgraph)
Tests if subgraph removal will succeed. To succeed the subgraph must belong to this graph, it must be a consistent snapshot and cannot be null.

Parameters:
subgraph - the subgraph to be removed, which can be null.
Returns:
true if the subgraph will succeed, false otherwise.

canCopyHere

boolean canCopyHere(ISubCompoundGraph<? extends N,? extends E> subgraph)
Removes the nodes and edges defined in the subgraph from this graph. The subgraph must be consistent with this graph and be a subgraph of this graph.

Parameters:
subgraph - The subgraph to remove, cannot be null.
subGraph - the subgraph to test, can be null.
Returns:
true if the subgraph is valid to copy from, false otherwise.
Throws:
java.lang.IllegalArgumentException - if canRemoveSubgraph(subgraph) == false. void removeSubgraph(ISubCompoundGraph 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.

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
Throws:
java.lang.IllegalArgumentException - if canCopyHere(subGraph) == false.

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.