Package org.jgrapht.graph
Class DirectedMaskSubgraph<V,E>
- java.lang.Object
-
- org.jgrapht.graph.AbstractGraph<V,E>
-
- org.jgrapht.graph.MaskSubgraph<V,E>
-
- org.jgrapht.graph.DirectedMaskSubgraph<V,E>
-
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
DirectedGraph<V,E>
,Graph<V,E>
public class DirectedMaskSubgraph<V,E> extends MaskSubgraph<V,E> implements DirectedGraph<V,E>
A directed graph that is aMaskSubgraph
of another graph.- Since:
- July 5, 2007
-
-
Field Summary
-
Fields inherited from class org.jgrapht.graph.MaskSubgraph
base, edgeMask, edges, vertexMask, vertices
-
-
Constructor Summary
Constructors Constructor Description DirectedMaskSubgraph(DirectedGraph<V,E> base, java.util.function.Predicate<V> vertexMask, java.util.function.Predicate<E> edgeMask)
Create a new directedMaskSubgraph
of another graph.DirectedMaskSubgraph(DirectedGraph<V,E> base, MaskFunctor<V,E> mask)
Deprecated.in favor of using lambdas
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<E>
incomingEdgesOf(V vertex)
Returns a set of all edges incoming into the specified vertex.int
inDegreeOf(V vertex)
Returns the "in degree" of the specified vertex.int
outDegreeOf(V vertex)
Returns the "out degree" of the specified vertex.java.util.Set<E>
outgoingEdgesOf(V vertex)
Returns a set of all edges outgoing from the specified vertex.-
Methods inherited from class org.jgrapht.graph.MaskSubgraph
addEdge, addEdge, addVertex, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
-
Methods inherited from class org.jgrapht.graph.AbstractGraph
assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, toString, toStringFromSets
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jgrapht.Graph
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
-
-
-
-
Constructor Detail
-
DirectedMaskSubgraph
@Deprecated public DirectedMaskSubgraph(DirectedGraph<V,E> base, MaskFunctor<V,E> mask)
Deprecated.in favor of using lambdasCreate a new directedMaskSubgraph
of another graph.- Parameters:
base
- the base graphmask
- vertices and edges to exclude in the subgraph. If a vertex/edge is masked, it is as if it is not in the subgraph.
-
DirectedMaskSubgraph
public DirectedMaskSubgraph(DirectedGraph<V,E> base, java.util.function.Predicate<V> vertexMask, java.util.function.Predicate<E> edgeMask)
Create a new directedMaskSubgraph
of another graph.- Parameters:
base
- the base graphvertexMask
- vertices to exclude in the subgraph. If a vertex is masked, it is as if it is not in the subgraph. Edges incident to the masked vertex are also masked.edgeMask
- edges to exclude in the subgraph. If an edge is masked, it is as if it is not in the subgraph.
-
-
Method Detail
-
inDegreeOf
public int inDegreeOf(V vertex)
Returns the "in degree" of the specified vertex. An in degree of a vertex in a directed graph is the number of inward directed edges from that vertex. See http://mathworld.wolfram.com/Indegree.html.- Specified by:
inDegreeOf
in interfaceDirectedGraph<V,E>
- Parameters:
vertex
- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
-
incomingEdgesOf
public java.util.Set<E> incomingEdgesOf(V vertex)
Returns a set of all edges incoming into the specified vertex.- Specified by:
incomingEdgesOf
in interfaceDirectedGraph<V,E>
- Parameters:
vertex
- the vertex for which the list of incoming edges to be returned.- Returns:
- a set of all edges incoming into the specified vertex.
-
outDegreeOf
public int outDegreeOf(V vertex)
Returns the "out degree" of the specified vertex. An out degree of a vertex in a directed graph is the number of outward directed edges from that vertex. See http://mathworld.wolfram.com/Outdegree.html.- Specified by:
outDegreeOf
in interfaceDirectedGraph<V,E>
- Parameters:
vertex
- vertex whose degree is to be calculated.- Returns:
- the degree of the specified vertex.
-
outgoingEdgesOf
public java.util.Set<E> outgoingEdgesOf(V vertex)
Returns a set of all edges outgoing from the specified vertex.- Specified by:
outgoingEdgesOf
in interfaceDirectedGraph<V,E>
- Parameters:
vertex
- the vertex for which the list of outgoing edges to be returned.- Returns:
- a set of all edges outgoing from the specified vertex.
-
-