public final class CountAccumulator extends Accumulator
getResult
method variants.Modifier and Type | Class and Description |
---|---|
private class |
CountAccumulator.Data
A
DataBundle implementation which keeps a running iteration
count, and returns it upon request. |
Accumulator.DataBundle
Modifier and Type | Field and Description |
---|---|
(package private) static int |
WEIGHT
Relative weight of this accumulator type for sorting purposes
|
BASE_WEIGHT
Constructor and Description |
---|
CountAccumulator()
Constructor which stores no data source.
|
CountAccumulator(Resolvable dataSource,
boolean register)
Constructor which stores a
Resolvable as the accumulator's
data source. |
Modifier and Type | Method and Description |
---|---|
protected Accumulator.DataBundle |
createDataBundle()
Create a data bundle which understands how to calculate an iteration
count.
|
BaseDataType |
getFullResult()
Get the full result of all accumulations so far for this accumulator,
across all break groups.
|
java.lang.String |
getLabel()
Get the label associated with this accumulator type, for use in the UI.
|
integer |
getResult()
Get the full count of iterations performed for the enclosing loop.
|
integer |
getResult(Resolvable breakGroupKey)
Get the count of iterations performed for the enclosing loop, but only
since the current break group counter was last reset.
|
BaseDataType |
getSubResult()
Get the current subgroup result for the first registered break group in
this accumulator.
|
int |
getWeight()
Get the relative weight associated with this accumulator type, for use
in sorting accumulator instances of different types according to their
natural display order.
|
accumulate, accumulate, addBreakGroup, assign, breakGroupKeys, calculate, createUnknown, deepCopy, deleted, finished, getDataSource, getFirstBreakGroupKey, getType, ifEnded, isLastOfGroup, isSubgroupOnly, isSubOnly, isUndoable, isUninitialized, iterate, iterate, iterate, postponeReset, postponeUnknown, reset, resetData, retry, scopeDeleted, scopeFinished, scopeStart, setLastOfGroup, setSubgroupOnly, setSubOnly
changed, checkUndoable, checkUndoable, checkUndoable, getTransLevel, isGlobal, markUndoable, popBlock, rollback, setGlobal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initFailure
static final int WEIGHT
public CountAccumulator()
accumulate
method. The accumulator is registered with the AccumulatorManager and
the TransactionManager in the next scope.public CountAccumulator(Resolvable dataSource, boolean register)
Resolvable
as the accumulator's
data source. When an iteration occurs, the accumulator gathers its data
by resolving the current value of the data source. The accumulator is
registered with the AccumulatorManager and the TransactionManager, in the next scope.dataSource
- Data source from which data is collected.register
- This flag will be false
only if a copy object is instantiated.
Because we use the copy only for roll-back purposes, we do not need to add it to
the TransactionManager or AccumulatorManager.public BaseDataType getFullResult()
getFullResult
in class Accumulator
public BaseDataType getSubResult()
getSubResult
in class Accumulator
null
if no subgroups are being tracked by this
accumulator.public java.lang.String getLabel()
getLabel
in class Accumulator
public int getWeight()
getWeight
in class Accumulator
public integer getResult()
public integer getResult(Resolvable breakGroupKey)
breakGroupKey
- Key identifying the break group for which the data is desired.protected Accumulator.DataBundle createDataBundle()
createDataBundle
in class Accumulator
CountAccumulator.Data
.