Class SubGraphConstructor
- java.lang.Object
-
- de.uni_marburg.mdo_over.graphtools.SubGraphConstructor
-
public class SubGraphConstructor extends Object
Supports the construction of subgraphs of aModelGraph
. To that end, it maintains aModelGraphMapping
from the subgraph to the original graph and offers methods to extend the subgraph.- Author:
- S. John
-
-
Constructor Summary
Constructors Constructor Description SubGraphConstructor(ModelGraph completeGraph)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModelEdge
addEdgeCopy(ModelEdge edge)
Adds a copy of an edge of the complete graph to the subgraph if the edge is not already represented there.ModelNode
addNodeCopy(ModelNode node)
Adds a copy of a node of the complete graph to the subgraph if the node is not already represented there.ModelGraph
getCompleteGraph()
ModelGraphMapping
getMapping()
ModelGraph
getSubGraph()
-
-
-
Constructor Detail
-
SubGraphConstructor
public SubGraphConstructor(ModelGraph completeGraph)
-
-
Method Detail
-
addNodeCopy
public ModelNode addNodeCopy(ModelNode node) throws GraphManipulationException
Adds a copy of a node of the complete graph to the subgraph if the node is not already represented there.- Parameters:
node
- a node of the underlying complete graph- Returns:
- the node representing the given node in the subgraph
- Throws:
GraphManipulationException
- if adding the node was aborted - in this case the subgraph remains unchanged
-
addEdgeCopy
public ModelEdge addEdgeCopy(ModelEdge edge) throws GraphManipulationException
Adds a copy of an edge of the complete graph to the subgraph if the edge is not already represented there. Also creates and adds copies of source and target nodes if necessary.- Parameters:
edge
- an edge of the underlying complete graph- Returns:
- the edge representing the given edge in the subgraph
- Throws:
GraphManipulationException
- if adding the edge was aborted - in this case the subgraph remains unchanged
-
getCompleteGraph
public ModelGraph getCompleteGraph()
-
getSubGraph
public ModelGraph getSubGraph()
-
getMapping
public ModelGraphMapping getMapping()
-
-