Class IteratorItemStatsImpl<ITEM>

java.lang.Object
com.foreach.across.modules.web.ui.IteratorItemStatsImpl<ITEM>
All Implemented Interfaces:
IteratorItemStats<ITEM>

public class IteratorItemStatsImpl<ITEM> extends Object implements IteratorItemStats<ITEM>
Represents some contextual information about an item that is part of an iterable like collection. Keeps track of the item itself, its index and next/previous information.
Author:
Arne Vandamme
  • Constructor Details

    • IteratorItemStatsImpl

      public IteratorItemStatsImpl(ITEM item, int index, boolean last)
    • IteratorItemStatsImpl

      public IteratorItemStatsImpl(ITEM item, int index, boolean first, boolean last)
  • Method Details

    • getIndex

      public int getIndex()
      Specified by:
      getIndex in interface IteratorItemStats<ITEM>
      Returns:
      Index of the item in the collection.
    • hasPrevious

      public boolean hasPrevious()
      Specified by:
      hasPrevious in interface IteratorItemStats<ITEM>
      Returns:
      True if there are previous items in the collection.
    • isFirst

      public boolean isFirst()
      Specified by:
      isFirst in interface IteratorItemStats<ITEM>
      Returns:
      True if this item is the first one in the collection.
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface IteratorItemStats<ITEM>
      Returns:
      True if there are more items in the collection after this one.
    • isLast

      public boolean isLast()
      Specified by:
      isLast in interface IteratorItemStats<ITEM>
      Returns:
      True if this item is the last item in the collection.
    • getItem

      public ITEM getItem()
      Specified by:
      getItem in interface IteratorItemStats<ITEM>
      Returns:
      item itself