Class PagedList<E>

java.lang.Object
org.apache.ofbiz.base.util.collections.PagedList<E>
All Implemented Interfaces:
Iterable<E>

public class PagedList<E> extends Object implements Iterable<E>
Stores the result of a subset of data items from a source (such as EntityListIterator).
  • Constructor Details

    • PagedList

      public PagedList(int startIndex, int endIndex, int size, int viewIndex, int viewSize, List<E> data)
      Default constructor - populates all fields in this class
      Parameters:
      startIndex -
      endIndex -
      size -
      viewIndex -
      viewSize -
      data -
  • Method Details

    • empty

      public static <E> PagedList<E> empty(int viewIndex, int viewSize)
      Parameters:
      viewIndex -
      viewSize -
      Returns:
      an empty PagedList object
    • getStartIndex

      public int getStartIndex()
      Returns:
      the start index (for paginator) or known as low index
    • getEndIndex

      public int getEndIndex()
      Returns:
      the end index (for paginator) or known as high index
    • getSize

      public int getSize()
      Returns:
      the size of the full list, this can be the result of EntityListIterator.getResultsSizeAfterPartialList()
    • getData

      public List<E> getData()
      Returns:
      the paged data. Eg - the result from EntityListIterator.getPartialList()
    • getViewIndex

      public int getViewIndex()
      Returns:
      the view index supplied by client
    • getViewSize

      public int getViewSize()
      Returns:
      the view size supplied by client
    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E>
      Returns:
      an interator object over the data returned in getData() method of this class