Package com.berryworks.jquantify
Class MetricRepository
- java.lang.Object
-
- com.berryworks.jquantify.MetricRepository
-
- All Implemented Interfaces:
Serializable
public final class MetricRepository extends Object implements Serializable
A singleton repository for accessingMetricinstances by their label.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Metricget(String inLabel)Gets aMetricwith a specified label.Set<String>getLabels()Gets the labels for all metrics in the repository.MetricgetMetric(String inLabel)Gets aMetricwith a specified label.static MetricRepositoryinstance()Returns the singleton instance ofMetricRepository.static voidput(Metric inMetric)Places an instance ofMetricinto the repository.voidputMetric(Metric inMetric)Places an instance ofMetricinto the repository.
-
-
-
Method Detail
-
instance
public static MetricRepository instance()
Returns the singleton instance ofMetricRepository.- Returns:
- The unique instance of this class.
-
getLabels
public Set<String> getLabels()
Gets the labels for all metrics in the repository.- Returns:
- set of labels
-
getMetric
public Metric getMetric(String inLabel)
Gets aMetricwith a specified label.- Parameters:
inLabel- String label- Returns:
Metricwith the specified label, ornullif one does not exist.
-
putMetric
public void putMetric(Metric inMetric)
Places an instance ofMetricinto the repository.If the repository already contains a
Metricwith the same label, it is replaced with the specified one.- Parameters:
inMetric- Metric to be placed into the repository.
-
get
public static Metric get(String inLabel)
Gets aMetricwith a specified label.This static method is equivalent to
MetricRepository.instance().getMetric(label)- Parameters:
inLabel- String label- Returns:
Metricwith the specified label, ornullif one does not exist.
-
put
public static void put(Metric inMetric)
Places an instance ofMetricinto the repository.This static method is equivalent to
MetricRepository.instance().putMetric(metric)- Parameters:
inMetric-Metricto be placed into the repository
-
-