Package cdc.graphs.impl
Class FilteredSubGraph<N,E>
- java.lang.Object
-
- cdc.graphs.impl.FilteredSubGraph<N,E>
-
- Type Parameters:
N- Node classE- Edge class
- All Implemented Interfaces:
GraphAdapter<N,E>
public class FilteredSubGraph<N,E> extends Object implements GraphAdapter<N,E>
Graph built from an underlying graph, by applying filters to nodes and edges.It is the user responsibility to provide consistent filters. If the edge filter gives a positive answer for an edge, then the corresponding nodes should also be accepted.
- Author:
- Damien Carbonne
-
-
Constructor Summary
Constructors Constructor Description FilteredSubGraph(GraphAdapter<N,E> delegate)FilteredSubGraph(GraphAdapter<N,E> delegate, Predicate<N> nodePredicate, Predicate<E> edgePredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsEdge(E edge)booleancontainsNode(N node)Iterable<? extends E>getEdges()Iterable<? extends E>getEdges(N node, EdgeDirection direction)Iterable<? extends N>getNodes()NgetTip(E edge, EdgeTip tip)voidsetEdgePredicate(Predicate<E> predicate)voidsetNodePredicate(Predicate<N> predicate)-
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
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
-
-
-
-
Constructor Detail
-
FilteredSubGraph
public FilteredSubGraph(GraphAdapter<N,E> delegate)
-
-
Method Detail
-
getNodes
public final Iterable<? extends N> getNodes()
- Specified by:
getNodesin interfaceGraphAdapter<N,E>
-
containsNode
public final boolean containsNode(N node)
- Specified by:
containsNodein interfaceGraphAdapter<N,E>
-
getEdges
public final Iterable<? extends E> getEdges()
- Specified by:
getEdgesin interfaceGraphAdapter<N,E>
-
containsEdge
public final boolean containsEdge(E edge)
- Specified by:
containsEdgein interfaceGraphAdapter<N,E>
-
getEdges
public final Iterable<? extends E> getEdges(N node, EdgeDirection direction)
- Specified by:
getEdgesin interfaceGraphAdapter<N,E>
-
-