public class ConcurrentShortArray extends org.mini2Dx.gdx.utils.ShortArray implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.ReadWriteLock |
lock |
| Constructor and Description |
|---|
ConcurrentShortArray()
Creates an ordered array with a capacity of 16.
|
ConcurrentShortArray(boolean ordered,
int capacity) |
ConcurrentShortArray(boolean ordered,
short[] array,
int startIndex,
int count)
Creates a new array containing the elements in the specified array.
|
ConcurrentShortArray(int capacity)
Creates an ordered array with the specified capacity.
|
ConcurrentShortArray(java.lang.Short array)
Creates a new array containing the elements in the specific array.
|
ConcurrentShortArray(short[] array)
Creates a new ordered array containing the elements in the specified array.
|
ConcurrentShortArray(org.mini2Dx.gdx.utils.ShortArray array)
Creates a new array containing the elements in the specific array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value) |
void |
add(short value) |
void |
add(short value1,
short value2) |
void |
add(short value1,
short value2,
short value3) |
void |
add(short value1,
short value2,
short value3,
short value4) |
void |
addAll(short[] array,
int offset,
int length) |
void |
addAll(org.mini2Dx.gdx.utils.ShortArray array,
int offset,
int length) |
void |
clear() |
boolean |
contains(short value) |
short[] |
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.
|
short |
first()
Returns the first item.
|
short |
get(int index) |
org.mini2Dx.lockprovider.ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
void |
incr(int index,
short value) |
int |
indexOf(short value) |
void |
insert(int index,
short value) |
boolean |
isEmpty()
Returns true if the array is empty.
|
int |
lastIndexOf(char value) |
void |
mul(int index,
short value) |
boolean |
notEmpty()
Returns true if the array has one or more items.
|
short |
peek()
Returns the last item.
|
short |
pop()
Removes and returns the last item.
|
short |
random()
Returns a random item from the array, or zero if the array is empty.
|
boolean |
removeAll(org.mini2Dx.gdx.utils.ShortArray array)
Removes from this array all of elements contained in the specified array.
|
short |
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(short value) |
void |
reverse() |
void |
set(int index,
short value) |
short[] |
setSize(int newSize)
Sets the array size, leaving any values beyond the current size undefined.
|
short[] |
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) |
short[] |
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 ConcurrentShortArray()
public ConcurrentShortArray(int capacity)
capacity - public ConcurrentShortArray(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 ConcurrentShortArray(java.lang.Short array)
array - public ConcurrentShortArray(short[] array)
array - public ConcurrentShortArray(boolean ordered,
short[] 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 ConcurrentShortArray(org.mini2Dx.gdx.utils.ShortArray array)
array - public int size()
public void add(short value)
add in class org.mini2Dx.gdx.utils.ShortArraypublic void add(int value)
add in class org.mini2Dx.gdx.utils.ShortArraypublic void add(short value1,
short value2)
add in class org.mini2Dx.gdx.utils.ShortArraypublic void add(short value1,
short value2,
short value3)
add in class org.mini2Dx.gdx.utils.ShortArraypublic void add(short value1,
short value2,
short value3,
short value4)
add in class org.mini2Dx.gdx.utils.ShortArraypublic void addAll(org.mini2Dx.gdx.utils.ShortArray array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.ShortArraypublic void addAll(short[] array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.ShortArraypublic short get(int index)
get in class org.mini2Dx.gdx.utils.ShortArraypublic void set(int index,
short value)
set in class org.mini2Dx.gdx.utils.ShortArraypublic void incr(int index,
short value)
incr in class org.mini2Dx.gdx.utils.ShortArraypublic void mul(int index,
short value)
mul in class org.mini2Dx.gdx.utils.ShortArraypublic void insert(int index,
short value)
insert in class org.mini2Dx.gdx.utils.ShortArraypublic void swap(int first,
int second)
swap in class org.mini2Dx.gdx.utils.ShortArraypublic boolean contains(short value)
contains in class org.mini2Dx.gdx.utils.ShortArraypublic int indexOf(short value)
indexOf in class org.mini2Dx.gdx.utils.ShortArraypublic int lastIndexOf(char value)
lastIndexOf in class org.mini2Dx.gdx.utils.ShortArraypublic boolean removeValue(short value)
removeValue in class org.mini2Dx.gdx.utils.ShortArraypublic short removeIndex(int index)
removeIndex in class org.mini2Dx.gdx.utils.ShortArrayindex - public void removeRange(int start,
int end)
removeRange in class org.mini2Dx.gdx.utils.ShortArraystart - end - public boolean removeAll(org.mini2Dx.gdx.utils.ShortArray array)
removeAll in class org.mini2Dx.gdx.utils.ShortArrayarray - public short pop()
pop in class org.mini2Dx.gdx.utils.ShortArraypublic short peek()
peek in class org.mini2Dx.gdx.utils.ShortArraypublic short first()
first in class org.mini2Dx.gdx.utils.ShortArraypublic boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.ShortArraypublic boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.ShortArraypublic void clear()
clear in class org.mini2Dx.gdx.utils.ShortArraypublic short[] shrink()
shrink in class org.mini2Dx.gdx.utils.ShortArrayShortArray.itemspublic short[] ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.ShortArrayadditionalCapacity - ShortArray.itemspublic short[] setSize(int newSize)
setSize in class org.mini2Dx.gdx.utils.ShortArraynewSize - ShortArray.itemspublic void sort()
sort in class org.mini2Dx.gdx.utils.ShortArraypublic void reverse()
reverse in class org.mini2Dx.gdx.utils.ShortArraypublic void shuffle()
shuffle in class org.mini2Dx.gdx.utils.ShortArraypublic void truncate(int newSize)
truncate in class org.mini2Dx.gdx.utils.ShortArraynewSize - public short random()
random in class org.mini2Dx.gdx.utils.ShortArraypublic short[] toArray()
toArray in class org.mini2Dx.gdx.utils.ShortArraypublic int hashCode()
hashCode in class org.mini2Dx.gdx.utils.ShortArraypublic boolean equals(java.lang.Object object)
equals in class org.mini2Dx.gdx.utils.ShortArrayobject - public java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.ShortArraypublic java.lang.String toString(java.lang.String separator)
toString in class org.mini2Dx.gdx.utils.ShortArraypublic org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock