Class DirectedGraphElementWeights
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.Object,java.lang.Integer>
-
- org.processmining.models.graphbased.directed.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
-
-
Constructor Summary
Constructors Constructor Description DirectedGraphElementWeights()
-
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
-
-
-
-
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 identifierweight
- 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 identifierdefaultWeight
- 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 identifiertargetId
- The target node identifieredgeId
- The edge identifierweight
- 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 identifiertargetId
- The target node identifieredgeId
- The edge identifierdefaultWeight
- The default weight- Returns:
- The weight of the edge identified by its source identifier, target identifier, and its own identifier
-
-