Class GridCache
java.lang.Object
io.github.sefiraat.networks.slimefun.network.grid.GridCache
A class that stores the current state of a
NetworkGrid so it can be cached
when opened next time to create persistence.-
Constructor Summary
ConstructorsConstructorDescriptionGridCache(int page, int maxPages, io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder) Creates a new GridCache -
Method Summary
Modifier and TypeMethodDescriptionintGets the max number of pages within the cacheintgetPage()Gets the currently opened page for this cacheio.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrderGets the currentGridCache.SortOrderof this cachevoidvoidsetMaxPages(int maxPages) Sets the max number of pages for this cache.voidsetPage(int page) Sets the currently displayed page for this cachevoidsetSortOrder(io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder) Sets theGridCache.SortOrderof this cache
-
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 cachemaxPages- The max number of pages for the cachesortOrder- TheGridCache.SortOrderof 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 currentGridCache.SortOrderof this cache- Returns:
- The current
GridCache.SortOrderof this cache
-
setSortOrder
public void setSortOrder(@Nonnull io.github.sefiraat.networks.slimefun.network.grid.GridCache.SortOrder sortOrder) Sets theGridCache.SortOrderof this cache- Parameters:
sortOrder- TheGridCache.SortOrderto apply.
-
getFilter
-
setFilter
-