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