begin() is called to occur once end() is called. This can allow code out of your control to remove items
without affecting iteration. Between begin and end, most mutator methods will throw IllegalStateException. Only
removeIndex(int), removeValue(Object, boolean), removeRange(int, int), clear(), and add
methods are allowed.
Note that DelayedRemovalArray is not for thread safety, only for removal during iteration.
Code using this class must not rely on items being removed immediately. Consider using SnapshotArray if this is a
problem.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private IntArray |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | insertRange(int index, int count)
Overrides com. Inserts the specified number of items at the specified index. |
| public T | |
| private void | |
| public T | removeIndex(int index)
Overrides com. Removes and returns the item at the specified index. |
| public void | removeRange(int start, int end)
Overrides com. Removes the items between the specified indices, inclusive. |
| public boolean | removeValue(T value, boolean identity)
Overrides com. Removes the first instance of the specified value in the array. |
| public int | replaceAll(T value, boolean identity, T replacement)
Overrides com. Returns the number of replacements done. |
| public boolean | replaceFirst(T value, boolean identity, T replacement)
Overrides com. Returns true if the specified value was replaced successfully with the replacement |
| public void | |
| public void | |
| public T[] | setSize(int newSize)
Overrides com. Sets the array size, leaving any values beyond the current size null. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | truncate(int newSize)
Overrides com. Reduces the size of the array to the specified size. |
| public static <T> DelayedRemovalArray |
| clear | back to summary |
|---|---|
| private int clear | |
| iterating | back to summary |
|---|---|
| private int iterating | |
| remove | back to summary |
|---|---|
| private IntArray remove | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray() | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(Array<T> array) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(boolean ordered, int capacity, ArraySupplier<T[]> arraySupplier) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(boolean ordered, int capacity, Class<T> arrayType)
Deprecated
| |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(boolean ordered, int capacity) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(boolean ordered, T[] array, int startIndex, int count) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(ArraySupplier<T[]> arraySupplier) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(Class<T> arrayType)
Deprecated
| |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(int capacity) | |
| DelayedRemovalArray | back to summary |
|---|---|
| public DelayedRemovalArray(T[] array) | |
| begin | back to summary |
|---|---|
| public void begin() | |
| clear | back to summary |
|---|---|
| public void clear() Overrides com. | |
| end | back to summary |
|---|---|
| public void end() | |
| insert | back to summary |
|---|---|
| public void insert(int index, T value) Overrides com. | |
| insertRange | back to summary |
|---|---|
| public void insertRange(int index, int count) Overrides com. Doc from com. Inserts the specified number of items at the specified index. The new items will have values equal to the values at those indices before the insertion. | |
| pop | back to summary |
|---|---|
| public T pop() Overrides com. Doc from com. Removes and returns the last item. | |
| remove | back to summary |
|---|---|
| private void remove(int index) | |
| removeIndex | back to summary |
|---|---|
| public T removeIndex(int index) Overrides com. Doc from com. Removes and returns the item at the specified index. | |
| removeRange | back to summary |
|---|---|
| public void removeRange(int start, int end) Overrides com. Doc from com. Removes the items between the specified indices, inclusive. | |
| removeValue | back to summary |
|---|---|
| public boolean removeValue(T value, boolean identity) Overrides com. Doc from com. Removes the first instance of the specified value in the array. | |
| replaceAll | back to summary |
|---|---|
| public int replaceAll(T value, boolean identity, T replacement) Overrides com. Doc from com. Returns the number of replacements done. | |
| replaceFirst | back to summary |
|---|---|
| public boolean replaceFirst(T value, boolean identity, T replacement) Overrides com. Doc from com. Returns true if the specified value was replaced successfully with the replacement | |
| reverse | back to summary |
|---|---|
| public void reverse() Overrides com. | |
| set | back to summary |
|---|---|
| public void set(int index, T value) Overrides com. | |
| setSize | back to summary |
|---|---|
| public T[] setSize(int newSize) Overrides com. Doc from com. Sets the array size, leaving any values beyond the current size null. | |
| shuffle | back to summary |
|---|---|
| public void shuffle() Overrides com. | |
| sort | back to summary |
|---|---|
| public void sort() Overrides com. Doc from com. Sorts this array. The array elements must implement | |
| sort | back to summary |
|---|---|
| public void sort(Comparator<? super T> comparator) Overrides com. Doc from com. Sorts the array. This method is not thread safe (uses | |
| swap | back to summary |
|---|---|
| public void swap(int first, int second) Overrides com. | |
| truncate | back to summary |
|---|---|
| public void truncate(int newSize) Overrides com. Doc from com. Reduces the size of the array to the specified size. If the array is already smaller than the specified size, no action is taken. | |
| with | back to summary |
|---|---|
| public static <T> DelayedRemovalArray Hides com.
| |