Class StrictArray<T>

java.lang.Object
com.badlogic.gdx.utils.Array<T>
com.prineside.tdi2.utils.StrictArray<T>
All Implemented Interfaces:
Iterable<T>

public class StrictArray<T> extends com.badlogic.gdx.utils.Array<T>
Не позволяет удалять элементы во время итерации Вложенная итерация разрешена
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.badlogic.gdx.utils.Array

    com.badlogic.gdx.utils.Array.ArrayIterable<T>, com.badlogic.gdx.utils.Array.ArrayIterator<T>
  • Field Summary

    Fields inherited from class com.badlogic.gdx.utils.Array

    items, ordered, size
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    StrictArray(boolean ordered, int capacity)
     
    StrictArray(boolean ordered, int capacity, Class arrayType)
     
    StrictArray(boolean ordered, T[] array, int startIndex, int count)
     
    StrictArray(int capacity)
     
    StrictArray(com.badlogic.gdx.utils.Array array)
     
    StrictArray(Class arrayType)
     
    StrictArray(T[] array)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bi()
     
    void
     
    void
    ei()
     
    void
    insert(int index, T value)
     
    pop()
    Removes and returns the last item.
    boolean
    removeAll(com.badlogic.gdx.utils.Array<? extends T> array, boolean identity)
    Removes from this array all of elements contained in the specified array.
    removeIndex(int index)
    Removes and returns the item at the specified index.
    void
    removeRange(int start, int end)
    Removes the items between the specified indices, inclusive.
    boolean
    removeValue(T value, boolean identity)
    Removes the first instance of the specified value in the array.
    void
     
    void
    set(int index, T value)
     
    T[]
    setSize(int newSize)
    Sets the array size, leaving any values beyond the current size null.
    void
     
    void
    Sorts this array.
    void
    sort(Comparator<? super T> comparator)
    Sorts the array.
    void
    swap(int first, int second)
     
    void
    truncate(int newSize)
    Reduces the size of the array to the specified size.

    Methods inherited from class com.badlogic.gdx.utils.Array

    add, add, add, add, addAll, addAll, addAll, addAll, contains, containsAll, containsAny, ensureCapacity, equals, equalsIdentity, first, get, hashCode, indexOf, insertRange, isEmpty, iterator, lastIndexOf, notEmpty, of, of, peek, random, select, selectRanked, selectRankedIndex, shrink, toArray, toArray, toString, toString, with

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • StrictArray

      public StrictArray()
    • StrictArray

      public StrictArray(com.badlogic.gdx.utils.Array array)
    • StrictArray

      public StrictArray(boolean ordered, int capacity, Class arrayType)
    • StrictArray

      public StrictArray(boolean ordered, int capacity)
    • StrictArray

      public StrictArray(boolean ordered, T[] array, int startIndex, int count)
    • StrictArray

      public StrictArray(Class arrayType)
    • StrictArray

      public StrictArray(int capacity)
    • StrictArray

      public StrictArray(T[] array)
  • Method Details

    • bi

      public void bi()
    • ei

      public void ei()
    • set

      public void set(int index, T value)
      Overrides:
      set in class com.badlogic.gdx.utils.Array<T>
    • insert

      public void insert(int index, T value)
      Overrides:
      insert in class com.badlogic.gdx.utils.Array<T>
    • swap

      public void swap(int first, int second)
      Overrides:
      swap in class com.badlogic.gdx.utils.Array<T>
    • removeValue

      public boolean removeValue(T value, boolean identity)
      Description copied from class: com.badlogic.gdx.utils.Array
      Removes the first instance of the specified value in the array.
      Overrides:
      removeValue in class com.badlogic.gdx.utils.Array<T>
      Parameters:
      value - May be null.
      identity - If true, == comparison will be used. If false, .equals() comparison will be used.
      Returns:
      true if value was found and removed, false otherwise
    • removeIndex

      public T removeIndex(int index)
      Description copied from class: com.badlogic.gdx.utils.Array
      Removes and returns the item at the specified index.
      Overrides:
      removeIndex in class com.badlogic.gdx.utils.Array<T>
    • removeRange

      public void removeRange(int start, int end)
      Description copied from class: com.badlogic.gdx.utils.Array
      Removes the items between the specified indices, inclusive.
      Overrides:
      removeRange in class com.badlogic.gdx.utils.Array<T>
    • removeAll

      public boolean removeAll(com.badlogic.gdx.utils.Array<? extends T> array, boolean identity)
      Description copied from class: com.badlogic.gdx.utils.Array
      Removes from this array all of elements contained in the specified array.
      Overrides:
      removeAll in class com.badlogic.gdx.utils.Array<T>
      identity - True to use ==, false to use .equals().
      Returns:
      true if this array was modified.
    • pop

      public T pop()
      Description copied from class: com.badlogic.gdx.utils.Array
      Removes and returns the last item.
      Overrides:
      pop in class com.badlogic.gdx.utils.Array<T>
    • clear

      public void clear()
      Overrides:
      clear in class com.badlogic.gdx.utils.Array<T>
    • setSize

      public T[] setSize(int newSize)
      Description copied from class: com.badlogic.gdx.utils.Array
      Sets the array size, leaving any values beyond the current size null.
      Overrides:
      setSize in class com.badlogic.gdx.utils.Array<T>
      Returns:
      Array.items
    • sort

      public void sort()
      Description copied from class: com.badlogic.gdx.utils.Array
      Sorts this array. The array elements must implement Comparable. This method is not thread safe (uses Sort.instance()).
      Overrides:
      sort in class com.badlogic.gdx.utils.Array<T>
    • sort

      public void sort(Comparator<? super T> comparator)
      Description copied from class: com.badlogic.gdx.utils.Array
      Sorts the array. This method is not thread safe (uses Sort.instance()).
      Overrides:
      sort in class com.badlogic.gdx.utils.Array<T>
    • reverse

      public void reverse()
      Overrides:
      reverse in class com.badlogic.gdx.utils.Array<T>
    • shuffle

      public void shuffle()
      Overrides:
      shuffle in class com.badlogic.gdx.utils.Array<T>
    • truncate

      public void truncate(int newSize)
      Description copied from class: com.badlogic.gdx.utils.Array
      Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken.
      Overrides:
      truncate in class com.badlogic.gdx.utils.Array<T>