Package ghidra.graph
Interface GEdgeWeightMetric<E extends GEdge<?>>
- Type Parameters:
E- the type of the edge
public interface GEdgeWeightMetric<E extends GEdge<?>>
A callback to get the weight of an edge
Analogous to Java's
Comparator, this provides a means to override the weight of an edge
in a graph, or provide a weight in the absence of a natural weight, when executing various graph
algorithms, e.g., shortest path.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GEdgeWeightMetric<?> static final GEdgeWeightMetric<?> -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeWeight(E e) Compute or retrieve the weight of the given edgestatic <V,E extends GEdge<V>>
GEdgeWeightMetric<E> Use the natural weight of each edge The metric assumes every edge is aGWeightedEdge.static <V,E extends GEdge<V>>
GEdgeWeightMetric<E> Measure every edge as having a weight of 1
-
Field Details
-
UNIT_METRIC
-
NATURAL_METRIC
-
-
Method Details
-
unitMetric
Measure every edge as having a weight of 1- Returns:
- the metric
-
naturalMetric
Use the natural weight of each edge The metric assumes every edge is aGWeightedEdge. If not, you will likely encounter aClassCastException.- Returns:
- the metric
-
computeWeight
Compute or retrieve the weight of the given edge- Parameters:
e- the edge- Returns:
- the weight
-