java.lang.Object
org.jgrapht.graph.concurrent.AsSynchronizedGraph.CacheAccess
- All Implemented Interfaces:
Serializable
,AsSynchronizedGraph.CacheStrategy<V,
E>
- Enclosing class:
AsSynchronizedGraph<V,
E>
private class AsSynchronizedGraph.CacheAccess
extends Object
implements AsSynchronizedGraph.CacheStrategy<V,E>, Serializable
Use cache for AsSynchronizedGraph's
edgesOf
, incomingEdgesOf
and
outgoingEdgesOf
methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd an edge into AsSynchronizedGraph's backing graph.boolean
Add an edge into AsSynchronizedGraph's backing graph.private void
edgeModified
(V sourceVertex, V targetVertex) Clear the copies which the edge to be added or removed can affect.Get all edges touching the specified vertex in AsSynchronizedGraph's backing graph.incomingEdgesOf
(V vertex) Get a set of all edges in AsSynchronizedGraph's backing graph incoming into the specified vertex.boolean
Return whether the graph uses cache foredgesOf
,incomingEdgesOf
andoutgoingEdgesOf
methods.outgoingEdgesOf
(V vertex) Get a set of all edges in AsSynchronizedGraph's backing graph outgoing from the specified vertex.boolean
removeEdge
(E e) Remove the specified edge from AsSynchronizedGraph's backing graph.removeEdge
(V sourceVertex, V targetVertex) Remove an edge from AsSynchronizedGraph's backing graph.boolean
removeVertex
(V v) Remove the specified vertex from AsSynchronizedGraph's backing graph.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
incomingEdgesMap
-
outgoingEdgesMap
-
edgesOfMap
-
-
Constructor Details
-
CacheAccess
private CacheAccess()
-
-
Method Details
-
addEdge
Add an edge into AsSynchronizedGraph's backing graph.- Specified by:
addEdge
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
addEdge
Add an edge into AsSynchronizedGraph's backing graph.- Specified by:
addEdge
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
edgesOf
Get all edges touching the specified vertex in AsSynchronizedGraph's backing graph.- Specified by:
edgesOf
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
incomingEdgesOf
Get a set of all edges in AsSynchronizedGraph's backing graph incoming into the specified vertex.- Specified by:
incomingEdgesOf
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
outgoingEdgesOf
Get a set of all edges in AsSynchronizedGraph's backing graph outgoing from the specified vertex.- Specified by:
outgoingEdgesOf
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
removeEdge
Remove the specified edge from AsSynchronizedGraph's backing graph.- Specified by:
removeEdge
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
removeEdge
Remove an edge from AsSynchronizedGraph's backing graph.- Specified by:
removeEdge
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
removeVertex
Remove the specified vertex from AsSynchronizedGraph's backing graph.- Specified by:
removeVertex
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E>
-
edgeModified
Clear the copies which the edge to be added or removed can affect.- Parameters:
sourceVertex
- source vertex of the modified edge.targetVertex
- target vertex of the modified edge.
-
isCacheEnabled
public boolean isCacheEnabled()Return whether the graph uses cache foredgesOf
,incomingEdgesOf
andoutgoingEdgesOf
methods.- Specified by:
isCacheEnabled
in interfaceAsSynchronizedGraph.CacheStrategy<V,
E> - Returns:
true
if cache is in use,false
if cache is not in use.
-