Package com.qfs.graph
Interface IConcurrentDirectedGraph<K,V,E>
- Type Parameters:
K- the type of the keys for the vertices.V- the type of the content for the vertices.E- the type of the edges. Edge convention: a null value for an edge between two nodes is interpreted as the absence of edges between these two nodes.
- All Superinterfaces:
IDirectedGraph<K,,V, E> Map<K,V>
- All Known Implementing Classes:
ConcurrentDirectedGraph
A
IDirectedGraph providing thread safety and atomicity guarantees. However some methods
does not offer guarantees about the consistency of the results when the graph is being modified
such as:
- Author:
- ActiveViam
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionputIfAbsent(K key, V value) If the specified key is not already associated with a value, associate it with the given value.booleanRemoves the entry for a key only if currently mapped to a given value.Replaces the entry for a key only if currently mapped to some value.booleanReplaces the entry for a key only if currently mapped to a given value.Methods inherited from interface com.qfs.graph.IDirectedGraph
addNode, filterEdges, forEachNode, getEdge, getEdges, getEdgesFrom, getEdgesTo, getNodes, getReached, getReachers, getTo, hasEdge, isAcyclic, moveKey, removeEdge, removeNode, setEdge, setNodeMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, remove, replaceAll, size, values
-
Method Details
-
putIfAbsent
If the specified key is not already associated with a value, associate it with the given value. Except that the action is performed atomically.- Specified by:
putIfAbsentin interfaceMap<K,V> - Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified key- Returns:
- the previous value associated with the specified key, or
nullif there was no mapping for the key. (Anullreturn can also indicate that the map previously associatednullwith the key, if the implementation supports null values.)
-
remove
Removes the entry for a key only if currently mapped to a given value. Except that the action is performed atomically. -
replace
Replaces the entry for a key only if currently mapped to a given value. Except that the action is performed atomically. -
replace
Replaces the entry for a key only if currently mapped to some value. Except that the action is performed atomically.- Specified by:
replacein interfaceMap<K,V> - Parameters:
key- key with which the specified value is associatedvalue- value to be associated with the specified key- Returns:
- the previous value associated with the specified key, or
nullif there was no mapping for the key. (Anullreturn can also indicate that the map previously associatednullwith the key, if the implementation supports null values.)
-