Class SubGraphConstructor


  • public class SubGraphConstructor
    extends Object
    Supports the construction of subgraphs of a ModelGraph. To that end, it maintains a ModelGraphMapping from the subgraph to the original graph and offers methods to extend the subgraph.
    Author:
    S. John
    • 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()