Class FastArrayList<T>

java.lang.Object
com.zenith.util.struct.FastArrayList<T>
Direct Known Subclasses:
SortedFastArrayList

public class FastArrayList<T> extends Object
An ArrayList implementation optimized for fast, direct, array access. Modifications have greatly increased overhead, implemented as copy-on-write For best performance, this list should be rarely mutated This class implements a very limited subset of the List interface, it's not intended to be a drop-in replacement for ArrayList or List
  • Field Details

    • array

      protected T @NonNull [] array
    • clazz

      protected final Class<T> clazz
  • Constructor Details

    • FastArrayList

      public FastArrayList(@NonNull Class<T> clazz)
  • Method Details

    • size

      public int size()
    • isEmpty

      public boolean isEmpty()
    • contains

      public boolean contains(Object o)
    • add

      public void add(@NonNull T element)
    • remove

      public boolean remove(@NonNull T element)
    • clear

      public void clear()
    • forEach

      public void forEach(Consumer<T> action)