java.lang.Object
io.github.sefiraat.networks.slimefun.network.grid.GridCache

public class GridCache extends Object
A class that stores the current state of a NetworkGrid so it can be cached when opened next time to create persistence.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GridCache(int page, int maxPages, io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder)
    Creates a new GridCache
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    Gets the max number of pages within the cache
    int
    Gets the currently opened page for this cache
    io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder
    Gets the current GridCache.SortOrder of this cache
    void
    setFilter(String filter)
     
    void
    setMaxPages(int maxPages)
    Sets the max number of pages for this cache.
    void
    setPage(int page)
    Sets the currently displayed page for this cache
    void
    setSortOrder(io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder)
    Sets the GridCache.SortOrder of this cache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GridCache

      public GridCache(int page, int maxPages, @Nonnull io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder)
      Creates a new GridCache
      Parameters:
      page - The page currently opened in the cache
      maxPages - The max number of pages for the cache
      sortOrder - The GridCache.SortOrder of this cache
  • Method Details

    • getPage

      public int getPage()
      Gets the currently opened page for this cache
      Returns:
      The currently opened page for this cache
    • setPage

      public void setPage(int page)
      Sets the currently displayed page for this cache
      Parameters:
      page - The page number to assign
    • getMaxPages

      public int getMaxPages()
      Gets the max number of pages within the cache
      Returns:
      the max number of pages within the cache
    • setMaxPages

      public void setMaxPages(int maxPages)
      Sets the max number of pages for this cache. Setting this beyond the number of items it can contain May lead to problems
      Parameters:
      maxPages - The max plages to display
    • getSortOrder

      @Nonnull public io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder getSortOrder()
      Gets the current GridCache.SortOrder of this cache
      Returns:
      The current GridCache.SortOrder of this cache
    • setSortOrder

      public void setSortOrder(@Nonnull io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder)
      Sets the GridCache.SortOrder of this cache
      Parameters:
      sortOrder - The GridCache.SortOrder to apply.
    • getFilter

      @Nullable public String getFilter()
    • setFilter

      public void setFilter(@Nullable String filter)