Enum Metric
- All Implemented Interfaces:
Serializable
,Comparable<Metric>
A coverage metric to identify the coverage result type. Note the enum order since the ordinal is used to sort the
values for display purposes.
- Author:
- Ullrich Hafner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Metric tendency: some metrics are getting better when the value is getting larger, some other metrics are getting better when the value is getting smaller. -
Enum Constant Summary
Enum ConstantDescriptionNodes that can have children.Coverage values without children.Additional metrics without children. -
Method Summary
Modifier and TypeMethodDescriptionstatic Metric
Returns the metric that belongs to the specified tag.static NavigableSet<Metric>
getValueFor
(Node node) Returns the aggregated value of this metric for the specified tree of nodes.boolean
Returns if a given metric is a node metric.Returns the name of the metric as a tag, containing only lowercase characters and dashes.static Metric
Returns the enum constant of this type with the specified name.static Metric[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CONTAINER
Nodes that can have children. -
MODULE
-
PACKAGE
-
FILE
-
CLASS
-
METHOD
-
LINE
Coverage values without children. -
BRANCH
-
INSTRUCTION
-
MUTATION
Additional metrics without children. -
COMPLEXITY
-
COMPLEXITY_MAXIMUM
-
COMPLEXITY_DENSITY
-
LOC
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromTag
Returns the metric that belongs to the specified tag.- Parameters:
tag
- the tag- Returns:
- the metric
- See Also:
-
getTendency
-
isContainer
public boolean isContainer()Returns if a given metric is a node metric.- Returns:
- if the metric is a node metric
-
toTagName
Returns the name of the metric as a tag, containing only lowercase characters and dashes.- Returns:
- the metric tag name
-
getValueFor
Returns the aggregated value of this metric for the specified tree of nodes.- Parameters:
node
- the root of the tree- Returns:
- the aggregated value
-
getCoverageMetrics
-