
com.senzing.util.Quantified Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of senzing-commons Show documentation
Show all versions of senzing-commons Show documentation
Utility classes and functions common to multiple Senzing projects.
The newest version!
package com.senzing.util;
import java.util.Map;
/**
* Interface used to describe a statistic.
*/
public interface Quantified {
/**
* Describes a statistic that is
*/
interface Statistic {
/**
* Gets the descriptive name of the statistic.
*
* @return The descriptive name of the statistic.
*/
default String getName() {
Class c = this.getClass();
Class enclosing = c.getEnclosingClass();
if (enclosing != null) {
return enclosing.getSimpleName() + ":" + this.toString();
} else {
return c.getSimpleName() + ":" + this.toString();
}
}
/**
* Gets the unit of measure for this statistic. This is the unit that
* the {@link Number} value that has been measured.
*
* @return The unit of measure for this statistic.
*/
String getUnits();
}
/**
* Gets the {@link Map} of {@link Statistic} keys to their {@link Number}
* values in an atomic thread-safe manner.
*
* @return The {@link Map} of {@link Statistic} keys to their {@link Number}
* values.
*/
Map getStatistics();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy