V
- the graph vertex typeE
- the graph edge typepublic class FastLookupUndirectedSpecifics<V,E> extends UndirectedSpecifics<V,E>
DirectedSpecifics
instead.Modifier and Type | Field and Description |
---|---|
protected Map<Pair<V,V>,ArrayUnenforcedSet<E>> |
touchingVerticesToEdgeMap |
abstractBaseGraph, edgeSetFactory, vertexMapUndirected
Constructor and Description |
---|
FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph)
Construct a new fast lookup undirected specifics.
|
FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph,
Map<V,UndirectedEdgeContainer<V,E>> vertexMap)
Construct a new fast lookup undirected specifics.
|
FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph,
Map<V,UndirectedEdgeContainer<V,E>> vertexMap,
EdgeSetFactory<V,E> edgeSetFactory)
Construct a new fast lookup undirected specifics.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdgeToTouchingVertices(E e)
Adds the specified edge to the edge containers of its source and target vertices.
|
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.
|
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.
|
void |
removeEdgeFromTouchingVertices(E e)
Removes the specified edge from the edge containers of its source and target vertices.
|
addVertex, degreeOf, edgesOf, getEdgeContainer, getVertexSet, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf
public FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph)
abstractBaseGraph
- the graph for which these specifics are forpublic FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph, Map<V,UndirectedEdgeContainer<V,E>> vertexMap)
abstractBaseGraph
- the graph for which these specifics are forvertexMap
- map for the storage of vertex edge setspublic FastLookupUndirectedSpecifics(AbstractBaseGraph<V,E> abstractBaseGraph, Map<V,UndirectedEdgeContainer<V,E>> vertexMap, EdgeSetFactory<V,E> edgeSetFactory)
abstractBaseGraph
- the graph for which these specifics are forvertexMap
- map for the storage of vertex edge setsedgeSetFactory
- factory for the creation of vertex edge setspublic Set<E> getAllEdges(V sourceVertex, V targetVertex)
null
, returns
null
. If both vertices exist but no edges found, returns an empty set.getAllEdges
in interface Specifics<V,E>
getAllEdges
in class UndirectedSpecifics<V,E>
sourceVertex
- source vertex of the edge.targetVertex
- target vertex of the edge.public 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.
public void addEdgeToTouchingVertices(E e)
addEdgeToTouchingVertices
in interface Specifics<V,E>
addEdgeToTouchingVertices
in class UndirectedSpecifics<V,E>
e
- the edgepublic void removeEdgeFromTouchingVertices(E e)
removeEdgeFromTouchingVertices
in interface Specifics<V,E>
removeEdgeFromTouchingVertices
in class UndirectedSpecifics<V,E>
e
- the edgeCopyright © 2018. All rights reserved.