private class MaximumAccumulator.Data extends java.lang.Object implements Accumulator.DataBundle
DataBundle
implementation which keeps track of the
maximum data value accumulated, and returns it upon request.Modifier and Type | Field and Description |
---|---|
private BaseDataType |
max
The current maximum value
|
Modifier | Constructor and Description |
---|---|
private |
Data() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(BaseDataType datum)
Compare
datum to the current maximum value. |
void |
assign(Undoable value)
Sets the state of this instance based on the state of the passed instance.
|
BaseDataType |
calculate()
Return the maximum value accumulated.
|
Undoable |
deepCopy()
This is a form of a copy constructor that makes a deep copy of the
current instance and returns this copy as a new instance of the same
class.
|
void |
reset()
Reset to unknown value the maximum value variable, in preparation
for beginning a new break group.
|
private BaseDataType max
public void reset()
reset
in interface Accumulator.DataBundle
public void accumulate(BaseDataType datum)
datum
to the current maximum value. If the
current maximum value is the unknown value, or if datum
compares as greater than the current maximum, datum
is
retained as the new maximum value. Otherwise, the old maximum value
is left unchanged.accumulate
in interface Accumulator.DataBundle
datum
- Datum to be accumulated.public BaseDataType calculate()
calculate
in interface Accumulator.DataBundle
public Undoable deepCopy()