public class ChatPaginator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ChatPaginator.ChatPage |
Modifier and Type | Field and Description |
---|---|
static int |
AVERAGE_CHAT_PAGE_WIDTH |
static int |
CLOSED_CHAT_PAGE_HEIGHT |
static int |
GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH |
static int |
OPEN_CHAT_PAGE_HEIGHT |
static int |
UNBOUNDED_PAGE_HEIGHT |
static int |
UNBOUNDED_PAGE_WIDTH |
Constructor and Description |
---|
ChatPaginator() |
Modifier and Type | Method and Description |
---|---|
static ChatPaginator.ChatPage |
paginate(String unpaginatedString,
int pageNumber)
Breaks a raw string up into pages using the default width and height.
|
static ChatPaginator.ChatPage |
paginate(String unpaginatedString,
int pageNumber,
int lineLength,
int pageHeight)
Breaks a raw string up into pages using a provided width and height.
|
static String[] |
wordWrap(String rawString,
int lineLength)
Breaks a raw string up into a series of lines.
|
public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH
public static final int AVERAGE_CHAT_PAGE_WIDTH
public static final int UNBOUNDED_PAGE_WIDTH
public static final int OPEN_CHAT_PAGE_HEIGHT
public static final int CLOSED_CHAT_PAGE_HEIGHT
public static final int UNBOUNDED_PAGE_HEIGHT
public static ChatPaginator.ChatPage paginate(String unpaginatedString, int pageNumber)
unpaginatedString
- The raw string to break.pageNumber
- The page number to fetch.public static ChatPaginator.ChatPage paginate(String unpaginatedString, int pageNumber, int lineLength, int pageHeight)
unpaginatedString
- The raw string to break.pageNumber
- The page number to fetch.lineLength
- The desired width of a chat line.pageHeight
- The desired number of lines in a page.public static String[] wordWrap(String rawString, int lineLength)
rawString
- The raw string to break.lineLength
- The length of a line of text.Copyright © 2021. All rights reserved.