public interface AsciiList
| Modifier and Type | Field and Description |
|---|---|
static String |
IMPLICIT_NEWLINE
A string representing an implicit new line for item rendering or internal processing such as word wrapping.
|
| Modifier and Type | Method and Description |
|---|---|
int |
calculateMaxIndentation()
Calculates indentation for each element of the list and returns the maximum value.
|
int |
calculateMaxIndentation(AsciiListItem item,
int position)
Calculates indentation for a list item.
|
AsciiList |
copy()
Returns a copy of the list.
|
List<Object> |
getItems()
Returns the items of the list.
|
int |
getLevel()
Returns the level of the list.
|
int |
getPostLabelIndent()
Sets the indentation to be used for an item after the label (and before the post-label string).
|
String |
getPostLabelString()
Sets a string to be printed after an item label (and before the post-label indentation).
|
int |
getPreLabelIndent()
Gets the indentation to be used for an item before the label (and after the pre-label string).
|
String |
getPreLabelString()
Sets a string to be printed before an item label (and after the pre-label indentation).
|
boolean |
isContinuedList()
Returns a flag indicating if the list is continued from a previous list of the same type or not.
|
void |
prepareRender()
Prepares a list to be rendered.
|
String |
render()
Renders the list, generates a string representation of it.
|
String |
renderItem(AsciiListItem item,
int position)
Renders a particular item of a list.
|
AsciiList |
setLabelDefaults()
Sets the values for pre/post paramters of labels back to their default values.
|
AsciiList |
setLevel(int level)
Sets the level of the list.
|
AsciiList |
setListStyle(ListStyle style)
Sets the style of a list.
|
AsciiList |
setPostLabelIndent(int indent)
Sets the indentation to be used for an item after the label (and before the post-label string).
|
AsciiList |
setPostLabelString(String str)
Sets a string to be printed after an item label (and before the post-label indentation).
|
AsciiList |
setPreLabelIndent(int indent)
Sets the indentation to be used for an item before the label (and after the pre-label string).
|
AsciiList |
setPreLabelString(String str)
Sets a string to be printed before an item label (and after the pre-label indentation).
|
AsciiList |
setWidth(int width)
Sets the (maximum) width a list (and all items and sub-lists) can have when being rendered.
|
static final String IMPLICIT_NEWLINE
AsciiList copy()
int getLevel()
int getPostLabelIndent()
String getPostLabelString()
int getPreLabelIndent()
String getPreLabelString()
boolean isContinuedList()
String render()
IllegalArgumentException - if a set width is too small for any list item being rendered intelligiblyvoid prepareRender()
int calculateMaxIndentation()
int calculateMaxIndentation(AsciiListItem item, int position)
item - the item to be used for calculationposition - the position of the item in the item listAsciiList setWidth(int width)
width - maximum widthString renderItem(AsciiListItem item, int position)
item - the item to be renderedposition - the position of the item in the item listAsciiList setLevel(int level)
level - new list level, should only be used if 2 or larger (nested list) using 1 as defaultAsciiList setListStyle(ListStyle style)
style - new list styleAsciiList setPostLabelIndent(int indent)
indent - post-label indentation, negative integer will use defaultAsciiList setPostLabelString(String str)
str - string for post labelAsciiList setPreLabelIndent(int indent)
indent - pre-label indentation, negative integer will use defaultAsciiList setPreLabelString(String str)
str - string for pre-labelAsciiList setLabelDefaults()
Copyright © 2015–2016. All rights reserved.