V
- the graph vertex typeE
- the graph edge typepublic class DirectedSubgraph<V,E> extends Subgraph<V,E,DirectedGraph<V,E>> implements DirectedGraph<V,E>
Subgraph
,
Serialized FormConstructor and Description |
---|
DirectedSubgraph(DirectedGraph<V,E> base)
Creates a new directed induced subgraph with all vertices included.
|
DirectedSubgraph(DirectedGraph<V,E> base,
Set<? extends V> vertexSubset)
Creates a new directed induced subgraph.
|
DirectedSubgraph(DirectedGraph<V,E> base,
Set<? extends V> vertexSubset,
Set<? extends E> edgeSubset)
Creates a new directed subgraph.
|
Modifier and Type | Method and Description |
---|---|
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.
|
Set<E> |
outgoingEdgesOf(V vertex)
Returns a set of all edges outgoing from the specified vertex.
|
addEdge, addEdge, addVertex, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getBase, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeEdge, removeEdge, removeVertex, setEdgeWeight, vertexSet
assertVertexExist, containsEdge, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSets
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet
public DirectedSubgraph(DirectedGraph<V,E> base, Set<? extends V> vertexSubset, Set<? extends E> edgeSubset)
base
- the base (backing) graph on which the subgraph will be based.vertexSubset
- vertices to include in the subgraph. If null
then all
vertices are included.edgeSubset
- edges to include in the subgraph. If null
then all the edges
whose vertices found in the graph are included.public DirectedSubgraph(DirectedGraph<V,E> base, Set<? extends V> vertexSubset)
base
- the base (backing) graph on which the subgraph will be based.vertexSubset
- vertices to include in the subgraph. If null
then all
vertices are included.public DirectedSubgraph(DirectedGraph<V,E> base)
base
- the base (backing) graph on which the subgraph will be based.public int inDegreeOf(V vertex)
inDegreeOf
in interface DirectedGraph<V,E>
vertex
- vertex whose degree is to be calculated.public Set<E> incomingEdgesOf(V vertex)
incomingEdgesOf
in interface DirectedGraph<V,E>
vertex
- the vertex for which the list of incoming edges to be returned.public int outDegreeOf(V vertex)
outDegreeOf
in interface DirectedGraph<V,E>
vertex
- vertex whose degree is to be calculated.public Set<E> outgoingEdgesOf(V vertex)
outgoingEdgesOf
in interface DirectedGraph<V,E>
vertex
- the vertex for which the list of outgoing edges to be returned.Copyright © 2017. All rights reserved.