excelExporter.excelParser.dataModel

## Class ObjectList<T>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.ArrayList<T>
      - - excelExporter.excelParser.dataModel.ObjectList<T>

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess

      public class ObjectList<T>
      extends java.util.ArrayList<T>

  A list of objects in the data model. Applied to the storage of row objects and groups of such in containers and of the containers themselves.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `objId` The ID of this object.
    `Identifier` | `parent` The parent of the list of data model objects is the name of the the list containing group.
    `SortOrder.Order` | `sortOrder` The chosen sort order of the list.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectList(Identifier parent)` Constructor for a new list.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int idx, T obj)` Add an element to the list.
    `boolean` | `add(T obj)` Add an element to the list.
    `int` | `getNoItems()` The number of contained data items.
    `void` | `sort(SortOrder.Comparator<? super T> comparator)` Sort the list with help of an external comparator.
    `java.lang.String` | `toString()` Get the string representation of the list; it's its parent's name.

    - ### Methods inherited from class java.util.ArrayList

      `addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.List

      `containsAll, equals, hashCode`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Field Detail

    - #### objId

          public final int objId

      The ID of this object. Each object in the data model gets a unique ID, which can be useful for having related data objects in the generated code with individual names.

    - #### parent

          public final Identifier parent

      The parent of the list of data model objects is the name of the the list containing group. Where group can refer to an Excel input defined group of row objects or to a global group of worksheets. If the list is the root collection, then the name is the name of the Excel worksheet.

    - #### sortOrder

          public SortOrder.Order sortOrder

      The chosen sort order of the list.

  - ### Constructor Detail

    - #### ObjectList

          public ObjectList(Identifier parent)

      Constructor for a new list.
      Parameters:
        `parent` - The name of the containing group.

  - ### Method Detail

    - #### getNoItems

          public int getNoItems()

      The number of contained data items. The number is accessible from a StringTemplate V4 template with an expression like `<list.noItems>`.
      Returns:
        Get the number if items in the list. Same as `ArrayList.size`.

    - #### add

          public boolean add(T obj)

      Add an element to the list. This method behaves like the superclass method besides that it invalidates the sort order recorded for this list.
      Specified by:
        `add` in interface `java.util.Collection<T>`
      Specified by:
        `add` in interface `java.util.List<T>`
      Overrides:
        `add` in class `java.util.ArrayList<T>`

    - #### add

          public void add(int idx,
                          T obj)

      Add an element to the list. This method behaves like the superclass method besides that it invalidates the sort order recorded for this list.
      Specified by:
        `add` in interface `java.util.List<T>`
      Overrides:
        `add` in class `java.util.ArrayList<T>`

    - #### sort

          public void sort(SortOrder.Comparator<? super T> comparator)

      Sort the list with help of an external comparator.
      Parameters:
        `comparator` - The externally provided comparator, suitable to compare two list elements.

    - #### toString

          public java.lang.String toString()

      Get the string representation of the list; it's its parent's name. From a StringTemplate V4 template this representation of the object is accessed as `<objectList>`.
      Overrides:
        `toString` in class `java.util.AbstractCollection<T>`
      Returns:
        The string value