Class NumberedList


public class NumberedList extends ListStructure

Implements a numbered list. Allows adding items, which will be formatted and printed into a list

Since:
0.0.11
Author:
Thomas Kwashnak
  • 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. Content
       

      With a required newline before and after the list

      Since:
      0.0.12
    • NumberedList

      public NumberedList(String name)

      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. Content
       

      With 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. Content
       

      With 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

      public NumberedList(String name, int start)

      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. Content
       

      with 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 list
      start - The number of the first item in the list
      Since:
      0.0.12
    • NumberedList

      public NumberedList(Object[] objects)

      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. Content
       

      with a required newline before and after the list

      Parameters:
      objects - Initial objects to include in the list
      Since:
      0.0.12
    • NumberedList

      public NumberedList(String name, Object[] objects)

      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. Content
       

      With a required newline after but not before the list

      Parameters:
      name - The list name to include before the list
      objects - Initial objects to include in the list
      Since:
      0.0.12
    • NumberedList

      public NumberedList(int start, Object[] objects)

      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. Content
       

      With 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
      objects - Initial objects to include in the list
      Since:
      0.0.12
    • NumberedList

      public NumberedList(String name, int start, Object[] objects)

      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. Content
       

      With 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 list
      start - The number of the first item in the list
      objects - Initial objects to include in the list
      Since:
      0.0.12
    • NumberedList

      public NumberedList(List<?> objects)
    • NumberedList

      public NumberedList(Stream<?> stream)
    • NumberedList

      public NumberedList(int start, List<?> objects)
    • NumberedList

      public NumberedList(int start, Stream<?> stream)
    • NumberedList

      public NumberedList(String name, List<?> objects)
    • NumberedList

      public NumberedList(String name, Stream<?> stream)
    • NumberedList

      public NumberedList(String name, int start, List<?> objects)
    • NumberedList

      public NumberedList(String name, int start, Stream<?> stream)
  • Method Details

    • getPrefix

      protected String getPrefix(int index)

      Generates the prefix to insert before a given item in the list.

      Specified by:
      getPrefix in class ListStructure
      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()