Class Array<T>

java.lang.Object
zombie.entity.util.Array<T>
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
SnapshotArray

public class Array<T> extends Object implements Iterable<T>
  • Field Details

    • items

      public T[] items
    • size

      public int size
    • ordered

      public boolean ordered
  • Constructor Details

    • Array

      public Array()
    • Array

      public Array(int capacity)
    • Array

      public Array(boolean ordered, int capacity)
    • Array

      public Array(boolean ordered, int capacity, Class<?> arrayType)
    • Array

      public Array(Class<?> arrayType)
    • Array

      public Array(Array<? extends T> array)
    • Array

      public Array(T[] array)
    • Array

      public Array(boolean ordered, T[] array, int start, int count)
  • Method Details

    • add

      public void add(T value)
    • add

      public void add(T value1, T value2)
    • add

      public void add(T value1, T value2, T value3)
    • add

      public void add(T value1, T value2, T value3, T value4)
    • addAll

      public void addAll(Array<? extends T> array)
    • addAll

      public void addAll(Array<? extends T> array, int start, int count)
    • addAll

      public void addAll(T... array)
    • addAll

      public void addAll(T[] array, int start, int count)
    • get

      public T get(int index)
    • set

      public void set(int index, T value)
    • insert

      public void insert(int index, T value)
    • insertRange

      public void insertRange(int index, int count)
    • swap

      public void swap(int first, int second)
    • contains

      public boolean contains(@Nullable T value, boolean identity)
    • containsAll

      public boolean containsAll(Array<? extends T> values, boolean identity)
    • containsAny

      public boolean containsAny(Array<? extends T> values, boolean identity)
    • indexOf

      public int indexOf(@Nullable T value, boolean identity)
    • lastIndexOf

      public int lastIndexOf(@Nullable T value, boolean identity)
    • removeValue

      public boolean removeValue(@Nullable T value, boolean identity)
    • removeIndex

      public T removeIndex(int index)
    • removeRange

      public void removeRange(int start, int end)
    • removeAll

      public boolean removeAll(Array<? extends T> array, boolean identity)
    • pop

      public T pop()
    • peek

      public T peek()
    • first

      public T first()
    • notEmpty

      public boolean notEmpty()
    • isEmpty

      public boolean isEmpty()
    • clear

      public void clear()
    • shrink

      public T[] shrink()
    • ensureCapacity

      public T[] ensureCapacity(int additionalCapacity)
    • setSize

      public T[] setSize(int newSize)
    • sort

      public void sort()
    • sort

      public void sort(Comparator<? super T> comparator)
    • selectRanked

      public T selectRanked(Comparator<T> comparator, int kthLowest)
    • selectRankedIndex

      public int selectRankedIndex(Comparator<T> comparator, int kthLowest)
    • reverse

      public void reverse()
    • shuffle

      public void shuffle()
    • iterator

      public Array.ArrayIterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • select

      public Iterable<T> select(Predicate<T> predicate)
    • truncate

      public void truncate(int newSize)
    • random

      public @Nullable T random()
    • toArray

      public T[] toArray()
    • toArray

      public <V> V[] toArray(Class<V> type)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • equalsIdentity

      public boolean equalsIdentity(Object object)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String separator)
    • of

      public static <T> Array<T> of(Class<T> arrayType)
    • of

      public static <T> Array<T> of(boolean ordered, int capacity, Class<T> arrayType)
    • with

      public static <T> Array<T> with(T... array)