Class ArrayModule<T>

java.lang.Object
com.github.collinalpert.java2db.modules.ArrayModule<T>
Type Parameters:
T - The type of the array.

public class ArrayModule<T>
extends Object
A helper module to work with arrays and especially adding elements to them.
Author:
Collin Alpert
  • Constructor Details

  • Method Details

    • getArray

      public T[] getArray()
      Gets an array with all the elements that were added to it. Should there be excess slots from when the array was extended to fit more elements, they will be trimmed away.
      Returns:
      An array containing the added elements.
    • addElement

      public void addElement​(T element)
      Adds an element to the array. When the max size of the array is reached, it is extended by the specified chunkSize in the constructor.
      Parameters:
      element - The element to add to the array.