public class ConcurrentIntArray extends org.mini2Dx.gdx.utils.IntArray implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentIntArray()
Creates an ordered array with a capacity of 16.
|
ConcurrentIntArray(boolean ordered,
int capacity) |
ConcurrentIntArray(boolean ordered,
int[] array,
int startIndex,
int count)
Creates a new array containing the elements in the specified array.
|
ConcurrentIntArray(int capacity)
Creates an ordered array with the specified capacity.
|
ConcurrentIntArray(int[] array)
Creates a new ordered array containing the elements in the specified array.
|
ConcurrentIntArray(org.mini2Dx.gdx.utils.IntArray array)
Creates a new array containing the elements in the specific array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value) |
void |
add(int value1,
int value2) |
void |
add(int value1,
int value2,
int value3) |
void |
add(int value1,
int value2,
int value3,
int value4) |
void |
addAll(int[] array,
int offset,
int length) |
void |
addAll(org.mini2Dx.gdx.utils.IntArray array,
int offset,
int length) |
void |
clear() |
boolean |
contains(int value) |
int[] |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
boolean |
equals(java.lang.Object object)
Returns false if either array is unordered.
|
int |
first()
Returns the first item.
|
int |
get(int index) |
org.mini2Dx.lockprovider.ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
void |
incr(int index,
int value) |
int |
indexOf(int value) |
void |
insert(int index,
int value) |
boolean |
isEmpty()
Returns true if the array is empty.
|
int |
lastIndexOf(int value) |
void |
mul(int index,
int value) |
boolean |
notEmpty()
Returns true if the array has one or more items.
|
int |
peek()
Returns the last item.
|
int |
pop()
Removes and returns the last item.
|
int |
random()
Returns a random item from the array, or zero if the array is empty.
|
boolean |
removeAll(org.mini2Dx.gdx.utils.IntArray array)
Removes from this array all of elements contained in the specified array.
|
int |
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(int value) |
void |
reverse() |
void |
set(int index,
int value) |
int[] |
setSize(int newSize)
Sets the array size, leaving any values beyond the current size undefined.
|
int[] |
shrink()
Reduces the size of the backing array to the size of the actual items.
|
void |
shuffle() |
int |
size()
Returns the size in a thread-safe manner
|
void |
sort() |
void |
swap(int first,
int second) |
int[] |
toArray() |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String separator) |
void |
truncate(int newSize)
Reduces the size of the array to the specified size.
|
public ConcurrentIntArray()
public ConcurrentIntArray(int capacity)
capacity - public ConcurrentIntArray(boolean ordered,
int capacity)
ordered - If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy.capacity - Any elements added beyond this will cause the backing array to be grown.public ConcurrentIntArray(org.mini2Dx.gdx.utils.IntArray array)
array - public ConcurrentIntArray(int[] array)
array - public ConcurrentIntArray(boolean ordered,
int[] array,
int startIndex,
int count)
ordered - If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy.array - startIndex - count - public int size()
public void add(int value)
add in class org.mini2Dx.gdx.utils.IntArraypublic void add(int value1,
int value2)
add in class org.mini2Dx.gdx.utils.IntArraypublic void add(int value1,
int value2,
int value3)
add in class org.mini2Dx.gdx.utils.IntArraypublic void add(int value1,
int value2,
int value3,
int value4)
add in class org.mini2Dx.gdx.utils.IntArraypublic void addAll(org.mini2Dx.gdx.utils.IntArray array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.IntArraypublic void addAll(int[] array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.IntArraypublic int get(int index)
get in class org.mini2Dx.gdx.utils.IntArraypublic void set(int index,
int value)
set in class org.mini2Dx.gdx.utils.IntArraypublic void incr(int index,
int value)
incr in class org.mini2Dx.gdx.utils.IntArraypublic void mul(int index,
int value)
mul in class org.mini2Dx.gdx.utils.IntArraypublic void insert(int index,
int value)
insert in class org.mini2Dx.gdx.utils.IntArraypublic void swap(int first,
int second)
swap in class org.mini2Dx.gdx.utils.IntArraypublic boolean contains(int value)
contains in class org.mini2Dx.gdx.utils.IntArraypublic int indexOf(int value)
indexOf in class org.mini2Dx.gdx.utils.IntArraypublic int lastIndexOf(int value)
lastIndexOf in class org.mini2Dx.gdx.utils.IntArraypublic boolean removeValue(int value)
removeValue in class org.mini2Dx.gdx.utils.IntArraypublic int removeIndex(int index)
removeIndex in class org.mini2Dx.gdx.utils.IntArrayindex - public void removeRange(int start,
int end)
removeRange in class org.mini2Dx.gdx.utils.IntArraystart - end - public boolean removeAll(org.mini2Dx.gdx.utils.IntArray array)
removeAll in class org.mini2Dx.gdx.utils.IntArrayarray - public int pop()
pop in class org.mini2Dx.gdx.utils.IntArraypublic int peek()
peek in class org.mini2Dx.gdx.utils.IntArraypublic int first()
first in class org.mini2Dx.gdx.utils.IntArraypublic boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.IntArraypublic boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.IntArraypublic void clear()
clear in class org.mini2Dx.gdx.utils.IntArraypublic int[] shrink()
shrink in class org.mini2Dx.gdx.utils.IntArrayIntArray.itemspublic int[] ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.IntArrayadditionalCapacity - IntArray.itemspublic int[] setSize(int newSize)
setSize in class org.mini2Dx.gdx.utils.IntArraynewSize - IntArray.itemspublic void sort()
sort in class org.mini2Dx.gdx.utils.IntArraypublic void reverse()
reverse in class org.mini2Dx.gdx.utils.IntArraypublic void shuffle()
shuffle in class org.mini2Dx.gdx.utils.IntArraypublic void truncate(int newSize)
truncate in class org.mini2Dx.gdx.utils.IntArraynewSize - public int random()
random in class org.mini2Dx.gdx.utils.IntArraypublic int[] toArray()
toArray in class org.mini2Dx.gdx.utils.IntArraypublic int hashCode()
hashCode in class org.mini2Dx.gdx.utils.IntArraypublic boolean equals(java.lang.Object object)
equals in class org.mini2Dx.gdx.utils.IntArrayobject - public java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.IntArraypublic java.lang.String toString(java.lang.String separator)
toString in class org.mini2Dx.gdx.utils.IntArraypublic org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock