Package cdc.graphs.impl
Class ExtensionSubGraph<N,E>
java.lang.Object
cdc.graphs.impl.GraphFilter<N,E>
cdc.graphs.impl.ExplicitSubGraph<N,E>
cdc.graphs.impl.ExtensionSubGraph<N,E>
- Type Parameters:
N- Node classE- Edge class
- All Implemented Interfaces:
GraphAdapter<N,E>
Explicit subgraph defined by extension.
At creation time the subgraph is empty. Nodes and edges are then added and removed again.
Nodes and edges of a subgraph should belong to delegate.
This is checked when possible, but if delegate changes, this is not
guaranteed.
- Author:
- Damien Carbonne
-
Field Summary
FieldsFields inherited from class cdc.graphs.impl.GraphFilter
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd an edge and the associated nodes to the subgraph.final voidAdd a node to the subgraph.final voidclear()Make the subgraph empty.final booleancontainsEdge(E edge) final booleancontainsNode(N node) getEdges()getEdges(N node, EdgeDirection direction) getNodes()final Nfinal booleanisEmpty()Return whether the subgraph is empty or not.final voidremoveEdge(E edge) Remove one edge.final voidremoveEdges(N source, N target) Remove all edges between a source and a target node.final voidremoveNode(N node) Remove one node and the associated edges.toString()Methods inherited from class cdc.graphs.impl.GraphFilter
checkEdgeValidity, checkNodeValidity, getDelegateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface cdc.graphs.GraphAdapter
getConnectedNodes, getConnectedNodes, getConnectivity, getEdges, getEdges, getEdges, getEdges, getEdgesCount, getEdgesCount, getEdgesCount, getEdgesStream, getEdgesStream, getEdgesStream, getLeaves, getNodes, getNodesCount, getNodesStream, getRoots, hasEdge, hasEdges, hasEdges, hasEdges, hasNodes, isLeaf, isRoot
-
Field Details
-
edges
Set of edges. They must also belong to delegate.
-
-
Constructor Details
-
ExtensionSubGraph
-
-
Method Details
-
clear
public final void clear()Description copied from class:ExplicitSubGraphMake the subgraph empty.- Specified by:
clearin classExplicitSubGraph<N,E>
-
isEmpty
public final boolean isEmpty()Description copied from class:ExplicitSubGraphReturn whether the subgraph is empty or not.- Specified by:
isEmptyin classExplicitSubGraph<N,E> - Returns:
- whether the subgraph is empty or not.
-
addNode
Description copied from class:ExplicitSubGraphAdd a node to the subgraph.- Specified by:
addNodein classExplicitSubGraph<N,E> - Parameters:
node- The node to add. Must belong to delegate.
-
removeNode
Description copied from class:ExplicitSubGraphRemove one node and the associated edges. If node does not belong to subgraph, does nothing.- Specified by:
removeNodein classExplicitSubGraph<N,E> - Parameters:
node- The node to remove.
-
addEdge
Description copied from class:ExplicitSubGraphAdd an edge and the associated nodes to the subgraph.- Specified by:
addEdgein classExplicitSubGraph<N,E> - Parameters:
edge- The edge to add. Must belong to delegate.
-
removeEdge
Description copied from class:ExplicitSubGraphRemove one edge. If edge does not belong to subgraph, does nothing.- Specified by:
removeEdgein classExplicitSubGraph<N,E> - Parameters:
edge- The edge to remove.
-
removeEdges
Description copied from class:ExplicitSubGraphRemove all edges between a source and a target node. If source or edge does not belong to subgraph, does nothing.- Specified by:
removeEdgesin classExplicitSubGraph<N,E> - Parameters:
source- The source node.target- The target node.
-
getNodes
-
containsNode
-
getEdges
-
containsEdge
-
getEdges
-
getTip
-
toString
-