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