Class BulletList


public class BulletList extends ListStructure

Implements a bulleted list

The typical format of a bulleted list is:

     - Content
     - Content
     - Content
 

The typical format of a bulleted list with a name is:

     Name
     - Content
     - Content
 
Since:
0.0.11
Author:
Thomas Kwashnak
  • Constructor Details

    • BulletList

      public BulletList()
      Creates an empty bullet list with no name
      Since:
      0.0.12
    • BulletList

      public BulletList(Object[] objects)
      Creates a bullet list with an initial set of items and no name
      Parameters:
      objects - The initial objects to add, in order
      Since:
      0.0.12
    • BulletList

      public BulletList(String name)
      Creates an empty list with a name
      Parameters:
      name - The string to print immediately before the list
      Since:
      0.0.12
    • BulletList

      public BulletList(String name, Object[] objects)
      Creates a list with initial contents and a set name
      Parameters:
      name - The string to print immediately before the list
      objects - The initial objects to add, in order
      Since:
      0.0.12
    • BulletList

      public BulletList(Stream<?> stream)
      Creates a list with initial contents from a stream
      Parameters:
      stream - Stream of objects to insert into the list
      Since:
      0.0.15
    • BulletList

      public BulletList(String name, Stream<?> stream)
      Creates a list with a name and initial contents from a stream
      Parameters:
      name - The string to print immediately before the list
      stream - Stream of objects to insert into the list
      Since:
      0.0.15
    • BulletList

      public BulletList(List<?> objects)
      Creates a list with initial contents from a list
      Parameters:
      objects - List of objects to include in the list
      Since:
      0.0.15
    • BulletList

      public BulletList(String name, List<?> objects)
      Creates a list with a set name and initial contents from a list
      Parameters:
      name - String to print immediately before the list
      objects - List of objects to include in the list
      Since:
      0.0.15
  • 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 - Index of the item
      Returns:
      "- "
      Since:
      0.0.11