public class StatisticMapper<SOURCE extends Enum<SOURCE>,TARGET extends Enum<TARGET>> extends Object implements OperationStatistic<TARGET>
| Constructor and Description |
|---|
StatisticMapper(Map<TARGET,Set<SOURCE>> translation,
OperationStatistic<SOURCE> statistic) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDerivedStatistic(ChainedOperationObserver<? super TARGET> derived)
Register the given
Observer to be called by this SourceStatistic |
void |
begin()
Called immediately prior to the operation beginning.
|
long |
count(TARGET type)
Return the count of operations with the given type.
|
void |
end(TARGET result)
Called immediately after the operation completes with no interesting parameters, and with the same thread the called {
OperationObserver.begin()} before. |
Collection<ChainedOperationObserver<? super TARGET>> |
getDerivedStatistics()
Retrieve all registered statistics.
|
void |
removeDerivedStatistic(ChainedOperationObserver<? super TARGET> derived)
Remove the given registered
Observer from this SourceStatistic. |
ValueStatistic<Long> |
statistic(Set<TARGET> results) |
ValueStatistic<Long> |
statistic(TARGET result)
Return a
ValueStatistic returning the count for the given result. |
long |
sum() |
long |
sum(Set<TARGET> types) |
Class<TARGET> |
type() |
public Class<TARGET> type()
type in interface OperationStatistic<TARGET extends Enum<TARGET>>public ValueStatistic<Long> statistic(TARGET result)
OperationStatisticValueStatistic returning the count for the given result.statistic in interface OperationStatistic<TARGET extends Enum<TARGET>>result - the result of interestValueStatistic instancepublic ValueStatistic<Long> statistic(Set<TARGET> results)
statistic in interface OperationStatistic<TARGET extends Enum<TARGET>>public long count(TARGET type)
OperationStatisticcount in interface OperationStatistic<TARGET extends Enum<TARGET>>type - the result typepublic long sum(Set<TARGET> types)
sum in interface OperationStatistic<TARGET extends Enum<TARGET>>public long sum()
sum in interface OperationStatistic<TARGET extends Enum<TARGET>>public void addDerivedStatistic(ChainedOperationObserver<? super TARGET> derived)
SourceStatisticObserver to be called by this SourceStatisticaddDerivedStatistic in interface SourceStatistic<ChainedOperationObserver<? super TARGET extends Enum<TARGET>>>derived - statistic to be registeredpublic void removeDerivedStatistic(ChainedOperationObserver<? super TARGET> derived)
SourceStatisticObserver from this SourceStatistic.removeDerivedStatistic in interface SourceStatistic<ChainedOperationObserver<? super TARGET extends Enum<TARGET>>>derived - statistic to be removedpublic Collection<ChainedOperationObserver<? super TARGET>> getDerivedStatistics()
SourceStatisticgetDerivedStatistics in interface SourceStatistic<ChainedOperationObserver<? super TARGET extends Enum<TARGET>>>public void begin()
OperationObserverbegin in interface OperationObserver<TARGET extends Enum<TARGET>>public void end(TARGET result)
OperationObserverOperationObserver.begin()} before.end in interface OperationObserver<TARGET extends Enum<TARGET>>result - the operation resultCopyright © 2018. All rights reserved.