public class Paginator extends Object
Constructor and Description |
---|
Paginator(String title,
int itemsPerPage,
List<String> content)
Constructor.
|
Paginator(String title,
int itemsPerPage,
String... itr)
Constructor.
|
Paginator(String title,
int itemsPerPage,
String wholeText)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getPage(int page)
Returns the appropriately formatted page for this
Paginator |
List<String> |
getPages()
Returns a copy of all the pages in this instance
|
int |
size()
Returns the number of pages in this instance
|
public Paginator(String title, int itemsPerPage, String wholeText)
wholeText
parameter by a newline
character (\n
) and forwards it to
Paginator(String, int, List)
title
- The title for the pagesitemsPerPage
- The number of items from the content parameter to
display on a pagewholeText
- A string to be split by the newline character \n
Paginator(String, int, List)
public Paginator(String title, int itemsPerPage, String... itr)
itr
parameter into a
List
and forwards it to
Paginator(String, int, List)
title
- The title for the pagesitemsPerPage
- The number of items from the content parameter to
display on a pageitr
- An iterable collection of stringsPaginator(String, int, List)
public Paginator(String title, int itemsPerPage, List<String> content)
List
of strings and creates formatted
pages which can be output to a
CommandSender
. These pages
should be considered immutable as they are only rendered once and then
subsequently stored.title
- The title for the pagesitemsPerPage
- The number of items from the content parameter to
display on a pagecontent
- A List
of strings to displaypublic String getPage(int page)
Paginator
page
- The page to retrievepublic int size()
Copyright © 2017. All rights reserved.