X - The context type.U - The type of per-user results. This is a plain Java class that has fields or methods
annotated with ResultColumn containing the per-user output columns.G - The type of global results. This is a plain Java class that has fields or methods
annotated with ResultColumn containing the aggregate output columns.public abstract class AbstractMetric<X,G,U> extends Object implements Metric<X>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMetric(Class<G> aggregate,
Class<U> user) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the metric.
|
protected abstract U |
doMeasureUser(TestUser user,
X context)
Measure a user with typed results.
|
List<String> |
getColumnLabels()
Get labels for the aggregate columns output by this evaluator.
|
protected String |
getPrefix()
A prefix to be applied to column names.
|
List<Object> |
getResults(X context)
Get the aggregate results from an accumulator.
|
protected String |
getSuffix()
A suffix to be applied to column names.
|
protected abstract G |
getTypedResults(X context)
Get the typed results from an accumulator.
|
List<String> |
getUserColumnLabels()
Get labels for the per-user columns output by this evaluator.
|
List<Object> |
measureUser(TestUser user,
X context)
Measure a user in the evaluation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateContextprotected String getPrefix()
null, this prefix will be applied and
separated with a period.protected String getSuffix()
null, this suffix will be applied and
separated with a period.public List<String> getColumnLabels()
MetricgetColumnLabels in interface Metric<X>public List<String> getUserColumnLabels()
MetricgetUserColumnLabels in interface Metric<X>Metric.measureUser(TestUser, Object)@Nonnull public List<Object> measureUser(TestUser user, X context)
MetricmeasureUser in interface Metric<X>user - The user to evaluate.context - The context for the active experimental condition.protected abstract U doMeasureUser(TestUser user, X context)
user - The user to measure.context - The context.null to emit NAs for the user.@Nonnull public List<Object> getResults(X context)
MetricgetResults in interface Metric<X>context - The context for an experimental condition.protected abstract G getTypedResults(X context)
context - The context.null to emit NAs.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if there is an error closing the metric.