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