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>
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
  • Method Details

    • 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:
      putIfAbsent in interface Map<K,V>
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
      Returns:
      the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with 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.
      Specified by:
      remove in interface Map<K,V>
      Parameters:
      key - key with which the specified value is associated
      value - value expected to be associated with the specified key
      Returns:
      true if the value was removed
    • 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.
      Specified by:
      replace in interface Map<K,V>
      Parameters:
      key - key with which the specified value is associated
      oldValue - value expected to be associated with the specified key
      newValue - value to be associated with the specified key
      Returns:
      true if the value was replaced
    • 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:
      replace in interface Map<K,V>
      Parameters:
      key - key with which the specified value is associated
      value - value to be associated with the specified key
      Returns:
      the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)