public interface StatisticsCalculator<I extends Document,O extends DocumentResult>
StatisticsCalculator interface represents a component that performs statistics calculation. At the first phase of
calculation, it accepts all Document one by one and produces statistics results DocumentResult. At the second phase, it
accepts a collection of produced results to aggregate and print statistics into some source. Implementation of that interface can have
some lifecycle methods annotated by follow annotations:
OnInit - method annotated by this annotation will be invoked after constructor
OnDestroy - method annotated by this annotation will be invoked once for one class instance after all another events. The method
annotated with Destroy is typically used to release resources that it has been holding.
| Modifier and Type | Method and Description |
|---|---|
void |
calculate(Collection<O> results)
Accepts a collection of of results for all documents that was produced in {
process(Document) method. |
O |
process(I document)
Accepts document to process and produces statistic result for that document.
|
O process(I document)
document - to processvoid calculate(Collection<O> results)
process(Document) method.
This method aggregates results and produce statistics into some source.results - to aggregateCopyright © 2019. All rights reserved.