public class DirectedGraphElementWeights
extends java.util.HashMap<java.lang.Object,java.lang.Integer>
Constructor and Description |
---|
DirectedGraphElementWeights() |
Modifier and Type | Method and 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.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public void add(java.lang.Object nodeId, int weight)
nodeId
- The node identifierweight
- The weight to addpublic int get(java.lang.Object nodeId, int defaultWeight)
nodeId
- The node identifierdefaultWeight
- The default weightpublic void add(java.lang.Object sourceId, java.lang.Object targetId, java.lang.Object edgeId, int weight)
sourceId
- The source node identifiertargetId
- The target node identifieredgeId
- The edge identifierweight
- The weight to addpublic int get(java.lang.Object sourceId, java.lang.Object targetId, java.lang.Object edgeId, int defaultWeight)
sourceId
- The source node identifiertargetId
- The target node identifieredgeId
- The edge identifierdefaultWeight
- The default weight