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
public interface IConcurrentDirectedGraph<K,V,E> extends IDirectedGraph<K,V,E>
AIDirectedGraphproviding 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VputIfAbsent(K key, V value)If the specified key is not already associated with a value, associate it with the given value.booleanremove(Object key, Object value)Removes the entry for a key only if currently mapped to a given value.Vreplace(K key, V value)Replaces the entry for a key only if currently mapped to some value.booleanreplace(K key, V oldValue, V newValue)Replaces 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, setNode
-
Methods 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 Detail
-
putIfAbsent
V putIfAbsent(K key, V value)
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
boolean remove(Object key, Object value)
Removes the entry for a key only if currently mapped to a given value. Except that the action is performed atomically.
-
replace
boolean replace(K key, V oldValue, V newValue)
Replaces the entry for a key only if currently mapped to a given value. Except that the action is performed atomically.
-
replace
V replace(K key, V value)
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.)
-
-