Class DirectedGraphElementWeights

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,​java.lang.Integer>

    public class DirectedGraphElementWeights
    extends java.util.HashMap<java.lang.Object,​java.lang.Integer>
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.Object nodeId, int weight)
      Add the given weight to the given object, which will typically be a node identifier.
      void add​(java.lang.Object sourceId, java.lang.Object targetId, java.lang.Object edgeId, int weight)
      Adds the given weight to the edge identified by its source identifier, target identifier, and its own identifier.
      int get​(java.lang.Object nodeId, int defaultWeight)
      Returns the current weight of the given object, which will typically be a node identifier.
      int get​(java.lang.Object sourceId, java.lang.Object targetId, java.lang.Object edgeId, int defaultWeight)
      Returns the current weight of the edge identified by its source identifier, target identifier, and its own identifier.
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Constructor Detail

      • DirectedGraphElementWeights

        public DirectedGraphElementWeights()
    • Method Detail

      • add

        public void add​(java.lang.Object nodeId,
                        int weight)
        Add the given weight to the given object, which will typically be a node identifier.
        Parameters:
        nodeId - The node identifier
        weight - The weight to add
      • get

        public int get​(java.lang.Object nodeId,
                       int defaultWeight)
        Returns the current weight of the given object, which will typically be a node identifier. Returns the given default weight if no current weight is found.
        Parameters:
        nodeId - The node identifier
        defaultWeight - The default weight
        Returns:
        The weight of the node with the given identifier
      • add

        public void add​(java.lang.Object sourceId,
                        java.lang.Object targetId,
                        java.lang.Object edgeId,
                        int weight)
        Adds the given weight to the edge identified by its source identifier, target identifier, and its own identifier. Note that the combination of these three should be unique.
        Parameters:
        sourceId - The source node identifier
        targetId - The target node identifier
        edgeId - The edge identifier
        weight - The weight to add
      • get

        public int get​(java.lang.Object sourceId,
                       java.lang.Object targetId,
                       java.lang.Object edgeId,
                       int defaultWeight)
        Returns the current weight of the edge identified by its source identifier, target identifier, and its own identifier. Returns the default weight if no current weight is found.
        Parameters:
        sourceId - The source node identifier
        targetId - The target node identifier
        edgeId - The edge identifier
        defaultWeight - The default weight
        Returns:
        The weight of the edge identified by its source identifier, target identifier, and its own identifier