V
- the graph vertex typeE
- the graph edge typepublic abstract class Specifics<V,E> extends Object implements Serializable
Constructor and Description |
---|
Specifics() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addEdgeToTouchingVertices(E e)
Adds the specified edge to the edge containers of its source and target vertices.
|
abstract void |
addVertex(V vertex)
Adds a vertex.
|
abstract int |
degreeOf(V vertex)
Returns the degree of the specified vertex.
|
abstract Set<E> |
edgesOf(V vertex)
Returns a set of all edges touching the specified vertex.
|
abstract Set<E> |
getAllEdges(V sourceVertex,
V targetVertex)
Returns a set of all edges connecting source vertex to target vertex if such vertices exist
in this graph.
|
abstract E |
getEdge(V sourceVertex,
V targetVertex)
Returns an edge connecting source vertex to target vertex if such vertices and such edge
exist in this graph.
|
abstract Set<V> |
getVertexSet()
Get the vertex set.
|
abstract Set<E> |
incomingEdgesOf(V vertex)
Returns a set of all edges incoming into the specified vertex.
|
abstract int |
inDegreeOf(V vertex)
Returns the "in degree" of the specified vertex.
|
abstract int |
outDegreeOf(V vertex)
Returns the "out degree" of the specified vertex.
|
abstract Set<E> |
outgoingEdgesOf(V vertex)
Returns a set of all edges outgoing from the specified vertex.
|
abstract void |
removeEdgeFromTouchingVertices(E e)
Removes the specified edge from the edge containers of its source and target vertices.
|
public abstract void addVertex(V vertex)
vertex
- vertex to be added.public abstract Set<E> getAllEdges(V sourceVertex, V targetVertex)
null
, returns
null
. If both vertices exist but no edges found, returns an empty set.sourceVertex
- source vertex of the edge.targetVertex
- target vertex of the edge.public abstract E getEdge(V sourceVertex, V targetVertex)
null
. If any of the specified vertices is null
returns null
In undirected graphs, the returned edge may have its source and target vertices in the opposite order.
sourceVertex
- source vertex of the edge.targetVertex
- target vertex of the edge.public abstract void addEdgeToTouchingVertices(E e)
e
- the edgepublic abstract int degreeOf(V vertex)
vertex
- vertex whose degree is to be calculated.public abstract Set<E> edgesOf(V vertex)
vertex
- the vertex for which a set of touching edges is to be returned.public abstract int inDegreeOf(V vertex)
vertex
- vertex whose in degree is to be calculated.public abstract Set<E> incomingEdgesOf(V vertex)
vertex
- the vertex for which the list of incoming edges to be returned.public abstract int outDegreeOf(V vertex)
vertex
- vertex whose out degree is to be calculated.public abstract Set<E> outgoingEdgesOf(V vertex)
vertex
- the vertex for which the list of outgoing edges to be returned.public abstract void removeEdgeFromTouchingVertices(E e)
e
- the edgeCopyright © 2016. All rights reserved.