public class EnumerateList extends AbstractAsciiList implements AsciiList_Enumerate
AsciiList_Enumerate.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isPrepared
Flag stating if the list is fully prepared for rendering.
|
protected String |
labelSeparator
A string to separate labels, default is dot.
|
protected int[] |
parents
The levels of the parents for nested enumerate lists 1.
|
protected int |
realPosition
The real position that is the position number an item belongs to, allowing for sub-lists belonging to an item here.
|
protected ListStyle_EnumerateNested |
style
The style for list items.
|
protected boolean |
useLabelSeparatorAfterLastItem
Flag for the use-label-separator-after-last-item behavior.
|
isContinued, items, level, maxItemIndent, postLabelIndent, postLabelStr, preLabelIndent, preLabelStr, widthIMPLICIT_NEWLINE| Constructor and Description |
|---|
EnumerateList()
Creates a new enumerate list.
|
EnumerateList(boolean isContinued)
Creates a new enumerate list.
|
EnumerateList(EnumerateList list)
Creates a new enumerate list as a copy of the original list.
|
| Modifier and Type | Method and Description |
|---|---|
AsciiList_Enumerate |
addAllItems(Collection<String> items)
Adds a collection of new items to the list.
|
AsciiList_Enumerate |
addItem(AsciiList list)
Adds a new list to the list.
|
AsciiList_Enumerate |
addItem(String item)
Adds a new item to the list.
|
protected String |
calculateItemLabel(int position)
Calculates and returns the label for a list item.
|
int |
calculateMaxIndentation(AsciiListItem item,
int position)
Calculates indentation for a list item.
|
AsciiList |
copy()
Returns a copy of the list.
|
String |
getLabelSeparator()
Returns the label separator, default is dot.
|
int[] |
getParents()
Returns the parents of nested enumerate lists.
|
boolean |
isPrepared()
Returns a flag stating if the list is prepared for rendering.
|
void |
prepareRender()
Prepares a list to be rendered.
|
String |
renderItem(AsciiListItem item,
int position)
Renders a particular item of a list.
|
AsciiList_Enumerate |
setLabelSeparator(String separator)
Sets the label separator, default is dot.
|
AsciiList_Enumerate |
setListStyle(ListStyle style)
Sets the style of a list.
|
AsciiList_Enumerate |
setParents(int[] parents)
Sets the parents (enumerations of all parent items) to generate for instance 1.
|
void |
setPrepared()
Sets the list as being prepared for rendering.
|
AsciiList_Enumerate |
useLabelSeparatorAfterLastItem(boolean flag)
Sets the behavior for using the label separator after the last item when rendering a list item.
|
calculateMaxIndentation, getItems, getLevel, getPostLabelIndent, getPostLabelString, getPreLabelIndent, getPreLabelString, isContinuedList, render, setLabelDefaults, setLevel, setPostLabelIndent, setPostLabelString, setPreLabelIndent, setPreLabelString, setWidth, wrapItem, wrapItemNextLineclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateMaxIndentation, getItems, getLevel, getPostLabelIndent, getPostLabelString, getPreLabelIndent, getPreLabelString, isContinuedList, render, setLabelDefaults, setLevel, setPostLabelIndent, setPostLabelString, setPreLabelIndent, setPreLabelString, setWidthprotected ListStyle_EnumerateNested style
protected int[] parents
protected boolean isPrepared
protected int realPosition
protected String labelSeparator
protected boolean useLabelSeparatorAfterLastItem
public EnumerateList()
public EnumerateList(boolean isContinued)
isContinued - true if continued from previous list of same type, false otherwisepublic EnumerateList(EnumerateList list)
list - original listpublic AsciiList_Enumerate addItem(AsciiList list)
AsciiList_EnumerateAsciiList.isContinuedList() returns true, not continued if it returns false.addItem in interface AsciiList_Enumeratelist - the new listpublic void prepareRender()
AsciiListprepareRender in interface AsciiListprepareRender in class AbstractAsciiListprotected String calculateItemLabel(int position)
position - the position of the item in the listpublic String renderItem(AsciiListItem item, int position)
AsciiListrenderItem in interface AsciiListitem - the item to be renderedposition - the position of the item in the item listpublic AsciiList_Enumerate setParents(int[] parents)
AsciiList_EnumeratesetParents in interface AsciiList_Enumerateparents - nested level, each entry in the array marks the position of a parentpublic int[] getParents()
AsciiList_EnumerategetParents in interface AsciiList_Enumeratepublic AsciiList_Enumerate setListStyle(ListStyle style)
AsciiListsetListStyle in interface AsciiListstyle - new list stylepublic AsciiList copy()
AsciiListpublic AsciiList_Enumerate setLabelSeparator(String separator)
AsciiList_EnumeratesetLabelSeparator in interface AsciiList_Enumerateseparator - new label separator, blank can be usedpublic String getLabelSeparator()
AsciiList_EnumerategetLabelSeparator in interface AsciiList_Enumeratepublic AsciiList_Enumerate useLabelSeparatorAfterLastItem(boolean flag)
AsciiList_EnumerateuseLabelSeparatorAfterLastItem in interface AsciiList_Enumerateflag - true if the separator should be used after the last item, false otherwisepublic int calculateMaxIndentation(AsciiListItem item, int position)
AsciiListcalculateMaxIndentation in interface AsciiListitem - the item to be used for calculationposition - the position of the item in the item listpublic AsciiList_Enumerate addItem(String item)
AsciiList_EnumerateaddItem in interface AsciiList_Enumerateitem - new item, only added if not blankpublic AsciiList_Enumerate addAllItems(Collection<String> items)
AsciiList_EnumerateaddAllItems in interface AsciiList_Enumerateitems - collection of items, individual items only added if not blankpublic boolean isPrepared()
AsciiList_EnumerateisPrepared in interface AsciiList_Enumeratepublic void setPrepared()
AsciiList_EnumeratesetPrepared in interface AsciiList_EnumerateCopyright © 2015–2016. All rights reserved.