Package com.prineside.tdi2.utils
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
ConstructorsConstructorDescriptionStrictArray(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 TypeMethodDescriptionvoidbi()voidclear()voidei()voidpop()Removes and returns the last item.booleanRemoves from this array all of elements contained in the specified array.removeIndex(int index) Removes and returns the item at the specified index.voidremoveRange(int start, int end) Removes the items between the specified indices, inclusive.booleanremoveValue(T value, boolean identity) Removes the first instance of the specified value in the array.voidreverse()voidT[]setSize(int newSize) Sets the array size, leaving any values beyond the current size null.voidshuffle()voidsort()Sorts this array.voidsort(Comparator<? super T> comparator) Sorts the array.voidswap(int first, int second) voidtruncate(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, withMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StrictArray
public StrictArray() -
StrictArray
public StrictArray(com.badlogic.gdx.utils.Array array) -
StrictArray
-
StrictArray
public StrictArray(boolean ordered, int capacity) -
StrictArray
-
StrictArray
-
StrictArray
public StrictArray(int capacity) -
StrictArray
-
-
Method Details
-
bi
public void bi() -
ei
public void ei() -
set
- Overrides:
setin classcom.badlogic.gdx.utils.Array<T>
-
insert
- Overrides:
insertin classcom.badlogic.gdx.utils.Array<T>
-
swap
public void swap(int first, int second) - Overrides:
swapin classcom.badlogic.gdx.utils.Array<T>
-
removeValue
Description copied from class:com.badlogic.gdx.utils.ArrayRemoves the first instance of the specified value in the array.- Overrides:
removeValuein classcom.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
Description copied from class:com.badlogic.gdx.utils.ArrayRemoves and returns the item at the specified index.- Overrides:
removeIndexin classcom.badlogic.gdx.utils.Array<T>
-
removeRange
public void removeRange(int start, int end) Description copied from class:com.badlogic.gdx.utils.ArrayRemoves the items between the specified indices, inclusive.- Overrides:
removeRangein classcom.badlogic.gdx.utils.Array<T>
-
removeAll
Description copied from class:com.badlogic.gdx.utils.ArrayRemoves from this array all of elements contained in the specified array.- Overrides:
removeAllin classcom.badlogic.gdx.utils.Array<T>identity- True to use ==, false to use .equals().- Returns:
- true if this array was modified.
-
pop
Description copied from class:com.badlogic.gdx.utils.ArrayRemoves and returns the last item.- Overrides:
popin classcom.badlogic.gdx.utils.Array<T>
-
clear
public void clear()- Overrides:
clearin classcom.badlogic.gdx.utils.Array<T>
-
setSize
Description copied from class:com.badlogic.gdx.utils.ArraySets the array size, leaving any values beyond the current size null.- Overrides:
setSizein classcom.badlogic.gdx.utils.Array<T>- Returns:
Array.items
-
sort
public void sort()Description copied from class:com.badlogic.gdx.utils.ArraySorts this array. The array elements must implementComparable. This method is not thread safe (usesSort.instance()).- Overrides:
sortin classcom.badlogic.gdx.utils.Array<T>
-
sort
Description copied from class:com.badlogic.gdx.utils.ArraySorts the array. This method is not thread safe (usesSort.instance()).- Overrides:
sortin classcom.badlogic.gdx.utils.Array<T>
-
reverse
public void reverse()- Overrides:
reversein classcom.badlogic.gdx.utils.Array<T>
-
shuffle
public void shuffle()- Overrides:
shufflein classcom.badlogic.gdx.utils.Array<T>
-
truncate
public void truncate(int newSize) Description copied from class:com.badlogic.gdx.utils.ArrayReduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken.- Overrides:
truncatein classcom.badlogic.gdx.utils.Array<T>
-