uk.ed.inf.graph.basic
Interface IBasicSubgraphFactory<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>

All Known Subinterfaces:
ISubCompoundGraphFactory<N,E>, IUndirectedSubgraphFactory<N,E>
All Known Implementing Classes:
BaseSubCompoundGraphFactory, SubCompoundGraphFactory, SubgraphFactory

public interface IBasicSubgraphFactory<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>


Method Summary
 void addEdge(E edge)
          Add an edge to the factory to be used to compose the subgraph.
 void addNode(N node)
          Add a node to the factory that will be used to compose the subgraph.
 IBasicSubgraph<N,E> createInducedSubgraph()
          Create an induced subgraph of the nodes and edges added to this factory.
 IBasicSubgraph<N,E> createSubgraph()
          Create a subgraph composed of the nodes and edges added to this factory.
 java.util.Iterator<E> edgeIterator()
          Iterate over the edges that have been added to the factory.
 IBasicGraph<N,E> getGraph()
          The graph that this factory will create a subgraph for.
 java.util.Iterator<N> nodeIterator()
          Iterate over the nodes that have been added to this factory.
 int numEdges()
          The number of edges added to the factory.
 int numNodes()
          Get the number of nodes added to the factory;
 

Method Detail

getGraph

IBasicGraph<N,E> getGraph()
The graph that this factory will create a subgraph for.

Returns:
the owning graph, which cannot be null.

addNode

void addNode(N node)
Add a node to the factory that will be used to compose the subgraph.

Parameters:
node - The node to be added. Cannot be null.
Throws:
java.lang.NullPointerException - if node is null.
java.lang.IllegalArgumentException - if node does not belong the the same graph as the factory.

numNodes

int numNodes()
Get the number of nodes added to the factory;

Returns:
the number of nodes.

addEdge

void addEdge(E edge)
Add an edge to the factory to be used to compose the subgraph.

Parameters:
edge -
Throws:
java.lang.NullPointerException - if edge is null.
java.lang.IllegalArgumentException - if edge does not belong the the same graph as the factory.

numEdges

int numEdges()
The number of edges added to the factory.

Returns:
the number of edges.

nodeIterator

java.util.Iterator<N> nodeIterator()
Iterate over the nodes that have been added to this factory.

Returns:
the node iterator, which cannot be null.

edgeIterator

java.util.Iterator<E> edgeIterator()
Iterate over the edges that have been added to the factory.

Returns:
the edge iterator that cannot be null.

createSubgraph

IBasicSubgraph<N,E> createSubgraph()
Create a subgraph composed of the nodes and edges added to this factory.

Returns:
the new subgraph, which cannot be null, but can be empty if no nodes and edges were added.

createInducedSubgraph

IBasicSubgraph<N,E> createInducedSubgraph()
Create an induced subgraph of the nodes and edges added to this factory. This subgraph also contains edges that exist between all the nodes added to the factory, even if they are not explicitly added to the factory.

Returns:
the new subgraph, which cannot be null, but can be empty if no nodes and edges held by the factory.