public class RepeatContextCounter
extends java.lang.Object
| Constructor and Description |
|---|
RepeatContextCounter(RepeatContext context,
java.lang.String countKey)
Convenience constructor with useParent=false.
|
RepeatContextCounter(RepeatContext context,
java.lang.String countKey,
boolean useParent)
Construct a new
RepeatContextCounter. |
| Modifier and Type | Method and Description |
|---|---|
int |
getCount() |
void |
increment()
Increment by 1.
|
void |
increment(int delta)
Increment the counter.
|
public RepeatContextCounter(RepeatContext context, java.lang.String countKey)
context - the current context.countKey - the key to use to store the counter in the context.public RepeatContextCounter(RepeatContext context, java.lang.String countKey, boolean useParent)
RepeatContextCounter.context - the current context.countKey - the key to use to store the counter in the context.useParent - true if the counter is to be shared between siblings.
The state will be stored in the parent of the context (if it exists)
instead of the context itself.