Package org.zkoss.zk.ui.util
Interface ForEachStatus
-
public interface ForEachStatusRepresents the runtime information of each iteration caused byForEach.The main use is to get the object in the outer iteration:
forEachStatus.previous.eachSince 8.0.0, we enhance this class to be consistent with JSTL's varStatus properties.
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.IntegergetBegin()Returns the index (starting from 0) that the iteration begins at, or null if not specified (and 0 is assumed).intgetCount()Retrieves the "count" of the current round of the iteration.java.lang.ObjectgetCurrent()Returns the object of this iteration.java.lang.IntegergetEnd()Returns the index (starting from 0) that the iteration ends at, or null if not specified (and the last element is assumed).intgetIndex()Returns the index of the current round of the iteration.ForEachStatusgetPrevious()Returns the status of the enclosing forEach statement.java.lang.IntegergetStep()Returns the value of the 'step' attribute for the associated tag, or null if no 'step' attribute was specified.booleanisFirst()Returns whether the current round is the first pass through the iterationbooleanisLast()Returns whether the current round is the last pass through the iteration
-
-
-
Method Detail
-
getPrevious
ForEachStatus getPrevious()
Returns the status of the enclosing forEach statement.
-
getCurrent
java.lang.Object getCurrent()
Returns the object of this iteration.- Since:
- 8.0.0
-
getIndex
int getIndex()
Returns the index of the current round of the iteration. If iteration is being performed over a subset of an underlying array, collection, or other type, the index returned is absolute with respect to the underlying collection. Indices are 0-based.For example, if the iteration starts at the fifth element (forEachBegin is 4), then the first value returned by this method will be 4.
-
getBegin
java.lang.Integer getBegin()
Returns the index (starting from 0) that the iteration begins at, or null if not specified (and 0 is assumed).
-
getEnd
java.lang.Integer getEnd()
Returns the index (starting from 0) that the iteration ends at, or null if not specified (and the last element is assumed).
-
isFirst
boolean isFirst()
Returns whether the current round is the first pass through the iteration- Since:
- 8.0.0
-
isLast
boolean isLast()
Returns whether the current round is the last pass through the iteration- Since:
- 8.0.0
-
getStep
java.lang.Integer getStep()
Returns the value of the 'step' attribute for the associated tag, or null if no 'step' attribute was specified.- Since:
- 8.0.0
-
getCount
int getCount()
Retrieves the "count" of the current round of the iteration. The count is a relative, 1-based sequence number identifying the current "round" of iteration (in context with all rounds the current iteration will perform). As an example, an iteration with begin = 5, end = 15, and step = 5 produces the counts 1, 2, and 3 in that order.- Since:
- 8.0.0
-
-