public class Metric extends Object implements Comparable<Metric>
Basically this combines a name along with a value and unit. Additionally an interpretation of the value is given as state.
Constructor and Description |
---|
Metric(String name,
double value,
MetricState state,
String unit)
Creates a new metric using the given values
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Metric o) |
boolean |
equals(Object o) |
String |
getName()
Returns the name of the metric.
|
MetricState |
getState()
Returns an interpretation of the value (@see MetricState).
|
String |
getUnit()
The unit in which the value is measured
|
double |
getValue()
Returns the actual value of the metric.
|
String |
getValueAsString()
String representation of the value along with its unit (is necessary)
|
int |
hashCode() |
public Metric(String name, double value, MetricState state, String unit)
name
- the name of the metricvalue
- the actual valuestate
- the interpretation of the valueunit
- the unit in which the value is measured or null if there is no unitpublic String getName()
public double getValue()
public String getUnit()
public String getValueAsString()
public MetricState getState()
public int compareTo(Metric o)
compareTo
in interface Comparable<Metric>
Copyright © 2018. All rights reserved.