|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.servlet.tag.IteratorStatus
public class IteratorStatus
Status of iteration of some looping tag.
The iterator tag can export an IteratorStatus object so that
one can get information about the status of the iteration, such as:
Example
<re:iter status="status" value='%{0, 1}'>
Index: <s:property value="%{#status.index}" /> <br />
Count: <s:property value="%{#status.count}" /> <br />
</re:iter>
will print
Index: 0
Count: 1
Index: 1
Count: 2
| Field Summary | |
|---|---|
protected int |
count
|
protected boolean |
last
|
protected int |
modulus
|
| Constructor Summary | |
|---|---|
IteratorStatus()
|
|
IteratorStatus(int modulus)
|
|
| Method Summary | |
|---|---|
int |
getCount()
Returns current item count (1-based). |
int |
getIndex()
Returns current index (zero-based). |
int |
getModulus()
Returns modulus of current count. |
boolean |
isEven()
Returns true if current count is even. |
boolean |
isFirst()
Returns true if current item is the first one. |
boolean |
isLast()
Returns true if current item is the last one. |
boolean |
isOdd()
Returns true if current count is odd. |
int |
modulus(int operand)
Calculates modulus of current count. |
protected void |
next(boolean isLast)
Performs the iterations to the next item and specifies if this is the last iteration. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final int modulus
protected boolean last
protected int count
| Constructor Detail |
|---|
public IteratorStatus()
public IteratorStatus(int modulus)
| Method Detail |
|---|
public int getCount()
public int getIndex()
public boolean isEven()
true if current count is even.
public boolean isOdd()
true if current count is odd.
public int modulus(int operand)
public int getModulus()
public boolean isFirst()
true if current item is the first one.
public boolean isLast()
true if current item is the last one.
protected void next(boolean isLast)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||