Class PageBag

java.lang.Object
de.chojo.jdautil.pagination.bag.PageBag
All Implemented Interfaces:
IPageBag
Direct Known Subclasses:
ListPageBag, PrivatePageBag

public abstract class PageBag extends Object implements IPageBag
A default page bag which circles through the pages.
  • Constructor Details

    • PageBag

      public PageBag(int pages)
  • Method Details

    • pages

      public int pages()
      Description copied from interface: IPageBag
      The amount of pages.
      Specified by:
      pages in interface IPageBag
      Returns:
      Page count
    • current

      public int current()
      Description copied from interface: IPageBag
      Get the current index of the page. The index is zero based
      Specified by:
      current in interface IPageBag
      Returns:
      the current page index. Zero based
    • scrollNext

      public void scrollNext()
      Description copied from interface: IPageBag
      Goes to the next page index
      Specified by:
      scrollNext in interface IPageBag
    • hasNext

      public boolean hasNext()
      Description copied from interface: IPageBag
      Checks if there is a next page
      Specified by:
      hasNext in interface IPageBag
      Returns:
      true when there is a next page
    • scrollPrevious

      public void scrollPrevious()
      Description copied from interface: IPageBag
      Goes to the previous page index
      Specified by:
      scrollPrevious in interface IPageBag
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: IPageBag
      Checks if there is a previous page
      Specified by:
      hasPrevious in interface IPageBag
      Returns:
      true when there is a previous page
    • current

      public void current(int page)
      Description copied from interface: IPageBag
      Set the current index of the page. The index is zero based
      Specified by:
      current in interface IPageBag
      Parameters:
      page - the current page index. Zero based