org.apache.struts2.util

## Class Counter

- java.lang.Object
- - org.apache.struts2.util.Counter

- All Implemented Interfaces:
    Serializable, Iterator

      public class Counter
      extends Object
      implements Iterator, Serializable

  A bean that can be used to keep track of a counter.

  Since it is an Iterator it can be used by the iterator tag

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Counter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCurrent()`
    `long` | `getFirst()`
    `long` | `getInterval()`
    `long` | `getLast()`
    `long` | `getNext()`
    `long` | `getPrevious()`
    `boolean` | `hasNext()`
    `boolean` | `isWrap()`
    `Object` | `next()`
    `void` | `remove()`
    `void` | `setAdd(long addition)`
    `void` | `setCurrent(long current)`
    `void` | `setFirst(long first)`
    `void` | `setInterval(long interval)`
    `void` | `setLast(long last)`
    `void` | `setWrap(boolean wrap)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### Counter

          public Counter()

  - ### Method Detail

    - #### setAdd

          public void setAdd(long addition)

    - #### setCurrent

          public void setCurrent(long current)

    - #### getCurrent

          public long getCurrent()

    - #### setFirst

          public void setFirst(long first)

    - #### getFirst

          public long getFirst()

    - #### setInterval

          public void setInterval(long interval)

    - #### getInterval

          public long getInterval()

    - #### setLast

          public void setLast(long last)

    - #### getLast

          public long getLast()

    - #### getNext

          public long getNext()

    - #### getPrevious

          public long getPrevious()

    - #### setWrap

          public void setWrap(boolean wrap)

    - #### isWrap

          public boolean isWrap()

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator`

    - #### next

          public Object next()

      Specified by:
        `next` in interface `Iterator`

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `Iterator`

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.