Package cdc.graphs.impl
Class ExplicitSubGraph<N,E>
java.lang.Object
cdc.graphs.impl.GraphFilter<N,E>
cdc.graphs.impl.ExplicitSubGraph<N,E>
- Type Parameters:
N- Node classE- Edge class
- All Implemented Interfaces:
GraphAdapter<N,E>
- Direct Known Subclasses:
ExtensionSubGraph,RestrictionSubGraph
Base class use to construct subgraphs by explicitly defining their content.
- Author:
- Damien Carbonne
- See Also:
-
Field Summary
Fields inherited from class cdc.graphs.impl.GraphFilter
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdd an edge and the associated nodes to the subgraph.abstract voidAdd a node to the subgraph.abstract voidclear()Make the subgraph empty.abstract booleanisEmpty()Return whether the subgraph is empty or not.abstract voidremoveEdge(E edge) Remove one edge.abstract voidremoveEdges(N source, N target) Remove all edges between a source and a target node.abstract voidremoveNode(N node) Remove one node and the associated edges.Methods inherited from class cdc.graphs.impl.GraphFilter
checkEdgeValidity, checkNodeValidity, getDelegateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cdc.graphs.GraphAdapter
containsEdge, containsNode, getConnectedNodes, getConnectedNodes, getConnectivity, getEdges, getEdges, getEdges, getEdges, getEdges, getEdges, getEdgesCount, getEdgesCount, getEdgesCount, getEdgesStream, getEdgesStream, getEdgesStream, getLeaves, getNodes, getNodes, getNodesCount, getNodesStream, getRoots, getTip, hasEdge, hasEdges, hasEdges, hasEdges, hasNodes, isLeaf, isRoot
-
Constructor Details
-
ExplicitSubGraph
-
-
Method Details
-
clear
public abstract void clear()Make the subgraph empty. -
isEmpty
public abstract boolean isEmpty()Return whether the subgraph is empty or not.- Returns:
- whether the subgraph is empty or not.
-
addNode
Add a node to the subgraph.- Parameters:
node- The node to add. Must belong to delegate.
-
removeNode
Remove one node and the associated edges. If node does not belong to subgraph, does nothing.- Parameters:
node- The node to remove.
-
addEdge
Add an edge and the associated nodes to the subgraph.- Parameters:
edge- The edge to add. Must belong to delegate.
-
removeEdge
Remove one edge. If edge does not belong to subgraph, does nothing.- Parameters:
edge- The edge to remove.
-
removeEdges
Remove all edges between a source and a target node. If source or edge does not belong to subgraph, does nothing.- Parameters:
source- The source node.target- The target node.
-