T - The type of element to which this metric can be applied.public interface Metric<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
isApplicable(T node)
Checks whether the metric is applicable to the given node.
|
Class<T> |
nodeType()
Gets the class type that the metric is applicable to.
|
static <T> Metric<T> |
of(Class<T> nodeType,
Predicate<? super T> filter,
String name,
double weight)
Factory method to create a new instance of a Metric with the given parameters.
|
double |
weight()
Gets the weight of the metric.
|
Class<T> nodeType()
boolean isApplicable(T node)
node - The node to check.double weight()
static <T> Metric<T> of(Class<T> nodeType, Predicate<? super T> filter, String name, double weight)
T - The type of element to which this metric can be applied.nodeType - The class type of the element.filter - The predicate to determine if the metric is applicable.name - The name of the metric.weight - The weight of the metric.Copyright © 2024. All rights reserved.