private class CountAccumulator.Data extends java.lang.Object implements Accumulator.DataBundle
DataBundle implementation which keeps a running iteration
count, and returns it upon request.| Modifier and Type | Field and Description |
|---|---|
private integer |
count
Iteration counter.
|
| Modifier | Constructor and Description |
|---|---|
private |
Data()
Construct an instance of this class, setting the starting total to
either unknown value or 0, depending upon whether the enclosing
accumulator is initialized for use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accumulate(BaseDataType datum)
Increment both the iteration count.
|
void |
assign(Undoable value)
Sets the state of this instance based on the state of the passed instance.
|
BaseDataType |
calculate()
Return the current iteration count.
|
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 zero) the counter variable, in preparation for beginning
a new break group.
|
private integer count
private Data()
public void reset()
reset in interface Accumulator.DataBundlepublic void accumulate(BaseDataType datum)
accumulate in interface Accumulator.DataBundledatum - Datum to be accumulated; ignored in this case, since it is
only the fact that the loop iterated which is important.public BaseDataType calculate()
calculate in interface Accumulator.DataBundleaccumulate(com.goldencode.p2j.util.BaseDataType) ever
occurred).public Undoable deepCopy()