Class Pagination.Impl

java.lang.Object
dev.aurelium.slate.inv.content.Pagination.Impl
All Implemented Interfaces:
Pagination
Enclosing interface:
Pagination

public static class Pagination.Impl extends Object implements Pagination
  • Constructor Details

    • Impl

      public Impl()
  • Method Details

    • getPageItems

      public ClickableItem[] getPageItems()
      Description copied from interface: Pagination
      Gets the items of the current page.
      This returns an array of the size of the items per page.
      Specified by:
      getPageItems in interface Pagination
      Returns:
      the current page items
    • getPage

      public int getPage()
      Description copied from interface: Pagination
      Gets the current page.
      Specified by:
      getPage in interface Pagination
      Returns:
      the current page
    • page

      public Pagination page(int page)
      Description copied from interface: Pagination
      Sets the current page.
      Specified by:
      page in interface Pagination
      Parameters:
      page - the current page
      Returns:
      this, for chained calls
    • isFirst

      public boolean isFirst()
      Description copied from interface: Pagination
      Checks if the current page is the first page.
      This is equivalent to: page == 0
      Specified by:
      isFirst in interface Pagination
      Returns:
      true if this page is the first page
    • isLast

      public boolean isLast()
      Description copied from interface: Pagination
      Checks if the current page is the last page.
      This is equivalent to: page == itemsCount / itemsPerPage
      Specified by:
      isLast in interface Pagination
      Returns:
      true if this page is the last page
    • first

      public Pagination first()
      Description copied from interface: Pagination
      Sets the current page to the first page.
      This is equivalent to: page(0)
      Specified by:
      first in interface Pagination
      Returns:
      this, for chained calls
    • previous

      public Pagination previous()
      Description copied from interface: Pagination
      Sets the current page to the previous page, if the current page is already the first page, this do nothing.
      Specified by:
      previous in interface Pagination
      Returns:
      this, for chained calls
    • next

      public Pagination next()
      Description copied from interface: Pagination
      Sets the current page to the next page, if the current page is already the last page, this do nothing.
      Specified by:
      next in interface Pagination
      Returns:
      this, for chained calls
    • last

      public Pagination last()
      Description copied from interface: Pagination
      Sets the current page to the last page.
      This is equivalent to: page(itemsCount / itemsPerPage)
      Specified by:
      last in interface Pagination
      Returns:
      this, for chained calls
    • addToIterator

      public Pagination addToIterator(SlotIterator iterator)
      Description copied from interface: Pagination
      Adds all the current page items to the given iterator.
      Specified by:
      addToIterator in interface Pagination
      Parameters:
      iterator - the iterator
      Returns:
      this, for chained calls
    • setItems

      public Pagination setItems(ClickableItem... items)
      Description copied from interface: Pagination
      Sets all the items for this Pagination.
      Specified by:
      setItems in interface Pagination
      Parameters:
      items - the items
      Returns:
      this, for chained calls
    • setItemsPerPage

      public Pagination setItemsPerPage(int itemsPerPage)
      Description copied from interface: Pagination
      Sets the maximum amount of items per page.
      Specified by:
      setItemsPerPage in interface Pagination
      Parameters:
      itemsPerPage - the maximum amount of items per page
      Returns:
      this, for chained calls