Class NumberedList
Implements a numbered list. Allows adding items, which will be formatted and printed into a list
- Since:
- 0.0.11
- Author:
- Thomas Kwashnak
-
Field Summary
Fields inherited from class org.tealeaf.javamarkdown.types.ListStructure
items, name -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty list with no name.NumberedList(int start) Creates an empty list with no name and a set starting digit.NumberedList(int start, Object[] objects) Creates a list with a set starting index and initial objectsNumberedList(int start, List<?> objects) NumberedList(int start, Stream<?> stream) NumberedList(Object[] objects) Creates a list with initial objects but no set nameNumberedList(String name) Creates an empty list with a set name.NumberedList(String name, int start) Creates an empty list with a set name and set starting digit.NumberedList(String name, int start, Object[] objects) Creates a list with a name, set starting index, and initial objectsNumberedList(String name, int start, List<?> objects) NumberedList(String name, int start, Stream<?> stream) NumberedList(String name, Object[] objects) Creates a list with a set name and initial objectsNumberedList(String name, List<?> objects) NumberedList(String name, Stream<?> stream) NumberedList(List<?> objects) NumberedList(Stream<?> stream) -
Method Summary
Methods inherited from class org.tealeaf.javamarkdown.types.ListStructure
add, add, asString, checkType, getItems, getName, printItem, requiresNewlineAfter, requiresNewlineBeforeMethods inherited from class org.tealeaf.javamarkdown.MarkdownElement
asString, toAppendable, toString, toWriter
-
Constructor Details
-
NumberedList
public NumberedList()Creates an empty list with no name.
Items must be added using
ListStructure.add(Object...)Once added, the list will be structured as the following
1. Content 2. Content 3. ContentWith a required newline before and after the list
- Since:
- 0.0.12
-
NumberedList
Creates an empty list with a set name.
Items must be added using
ListStructure.add(Object...)Once added, the list will be structured as the following
List Name 1. Content 2. Content 3. ContentWith a required newline after but not before the list.
- Parameters:
name- The list name to include before the list- Since:
- 0.0.12
-
NumberedList
public NumberedList(int start) Creates an empty list with no name and a set starting digit.
Items must be added using
ListStructure.add(Object...)Once added, the list will be structured like the following:
4. Content 5. Content 6. ContentWith a required newline before and after the list
The first digit is the digit set up in the parameters
- Parameters:
start- The number of the first item in the list- Since:
- 0.0.12
-
NumberedList
Creates an empty list with a set name and set starting digit.
Items must be added using
ListStructure.add(Object...)Once added, the list will be structured like the following:
List Name 4. Content 5. Content 6. Contentwith a required newline after but not before the list
The first digit is the digit set up in the parameters
- Parameters:
name- The list name to include before the liststart- The number of the first item in the list- Since:
- 0.0.12
-
NumberedList
Creates a list with initial objects but no set name
Items can still be added using
ListStructure.add(Object...)The list will be structured like the following:
1. Content 2. Content 3. Contentwith a required newline before and after the list
- Parameters:
objects- Initial objects to include in the list- Since:
- 0.0.12
-
NumberedList
Creates a list with a set name and initial objects
Items can still be added to the end using
ListStructure.add(Object...)The list will be structured like the following:
List Name 1. Content 2. Content 3. ContentWith a required newline after but not before the list
- Parameters:
name- The list name to include before the listobjects- Initial objects to include in the list- Since:
- 0.0.12
-
NumberedList
Creates a list with a set starting index and initial objects
Items can still be added to the end using
ListStructure.add(Object...)The items will be structured like the following:
4. Content 5. Content 6. ContentWith a required newline before and after the list
The first digit is the digit set up in the parameters
- Parameters:
start- The number of the first item in the listobjects- Initial objects to include in the list- Since:
- 0.0.12
-
NumberedList
Creates a list with a name, set starting index, and initial objects
Items can still be added to the end using
ListStructure.add(Object...)The items will be structured like the following:
List Name 4. Content 5. Content 6. ContentWith a required newline after but not before the list
The first digit is the digit set up in the parameters
- Parameters:
name- The list name to include before the liststart- The number of the first item in the listobjects- Initial objects to include in the list- Since:
- 0.0.12
-
NumberedList
-
NumberedList
-
NumberedList
-
NumberedList
-
NumberedList
-
NumberedList
-
NumberedList
-
NumberedList
-
-
Method Details
-
getPrefix
Generates the prefix to insert before a given item in the list.
- Specified by:
getPrefixin classListStructure- Parameters:
index- Item's index to get the prefix for- Returns:
- Prefix to insert before the item at the provided index
- Since:
- 0.0.11
-
getStart
public int getStart()
-