public final class MinimumAccumulator extends Accumulator
getResult
method variants.
The comparison to determine the minimum value from among two data values
being compared is specific to the particular BaseDataType
type and
instances being accumulated.
Modifier and Type | Class and Description |
---|---|
private class |
MinimumAccumulator.Data
A
DataBundle implementation which keeps track of the
minimum data value accumulated, 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 |
---|
MinimumAccumulator(BaseDataType variable)
Constructor which stores a mutable variable reference as the
accumulator's data source.
|
MinimumAccumulator(boolean value)
Create an instance which accumulates an integral constant upon each loop
iteration.
|
MinimumAccumulator(java.lang.Class<? extends BaseDataType> cls)
Constructor which stores no data source.
|
MinimumAccumulator(double value)
Create an instance which accumulates an integral constant upon each loop
iteration.
|
MinimumAccumulator(int value)
Create an instance which accumulates an integral constant upon each loop
iteration.
|
MinimumAccumulator(Resolvable dataSource)
Constructor which stores a
Resolvable as the accumulator's
data source. |
MinimumAccumulator(Resolvable dataSource,
boolean register)
Constructor which stores a
Resolvable as the accumulator's
data source. |
MinimumAccumulator(java.lang.String value)
Create an instance which accumulates an integral constant upon each loop
iteration.
|
Modifier and Type | Method and Description |
---|---|
protected Accumulator.DataBundle |
createDataBundle()
Create a data bundle which understands how to calculate a minimum value
from among the values accumulated.
|
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.
|
BaseDataType |
getResult()
Get the minimum value of all instances of the accumulated data source
across all iterations of the current break group.
|
BaseDataType |
getResult(Resolvable breakGroupKey)
Get the minimum value of all instances of the accumulated data source
across all iterations of the specified break group.
|
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
entry, initFailure, weight
static final int WEIGHT
public MinimumAccumulator(java.lang.Class<? extends BaseDataType> cls)
accumulate
method.cls
- Data type of the value being accumulated.public MinimumAccumulator(int value)
value
- Constant which will be accumulated at each iteration.public MinimumAccumulator(double value)
value
- Constant which will be accumulated at each iteration.public MinimumAccumulator(java.lang.String value)
value
- Constant which will be accumulated at each iteration.public MinimumAccumulator(boolean value)
value
- Constant which will be accumulated at each iteration.public MinimumAccumulator(BaseDataType variable)
variable
- Mutable variable from which data is collected.public MinimumAccumulator(Resolvable dataSource)
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 will be automatically registered at the NEXT scope that is opened. This is perfect for use in class members that are initialized in an initializer which occurs before the scope is open.
dataSource
- Data source from which data is collected.public MinimumAccumulator(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 BaseDataType getResult()
public BaseDataType getResult(Resolvable breakGroupKey)
breakGroupKey
- Key identifying the break group for which the data is desired.protected Accumulator.DataBundle createDataBundle()
createDataBundle
in class Accumulator
MinimumAccumulator.Data
.