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