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
public abstract class ExplicitSubGraph<N,E> extends GraphFilter<N,E>
Base class use to construct subgraphs by explicitly defining their content.- Author:
- Damien Carbonne
- See Also:
ExtensionSubGraph,RestrictionSubGraph
-
-
Field Summary
-
Fields inherited from class cdc.graphs.impl.GraphFilter
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExplicitSubGraph(GraphAdapter<N,E> delegate)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidaddEdge(E edge)Add an edge and the associated nodes to the subgraph.abstract voidaddNode(N node)Add 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, getDelegate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods 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 Detail
-
ExplicitSubGraph
protected ExplicitSubGraph(GraphAdapter<N,E> delegate)
-
-
Method Detail
-
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
public abstract void addNode(N node)
Add a node to the subgraph.- Parameters:
node- The node to add. Must belong to delegate.
-
removeNode
public abstract void removeNode(N node)
Remove one node and the associated edges. If node does not belong to subgraph, does nothing.- Parameters:
node- The node to remove.
-
addEdge
public abstract void addEdge(E edge)
Add an edge and the associated nodes to the subgraph.- Parameters:
edge- The edge to add. Must belong to delegate.
-
removeEdge
public abstract void removeEdge(E edge)
Remove one edge. If edge does not belong to subgraph, does nothing.- Parameters:
edge- The edge to remove.
-
-