public final class ObservableFloatArrayImpl extends ObservableArrayBase<ObservableFloatArray> implements ObservableFloatArray
| Modifier and Type | Field and Description |
|---|---|
private float[] |
array |
private static float[] |
INITIAL |
private static int |
MAX_ARRAY_SIZE
The maximum size of array to allocate.
|
private int |
size |
| Constructor and Description |
|---|
ObservableFloatArrayImpl()
Creates empty observable float array
|
ObservableFloatArrayImpl(float... elements)
Creates observable float array with copy of given initial values
|
ObservableFloatArrayImpl(ObservableFloatArray src)
Creates observable float array with copy of given observable float array
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(float... elements)
Appends given
elements to the end of this array. |
void |
addAll(float[] src,
int srcIndex,
int length)
Appends a portion of given array to the end of this array.
|
void |
addAll(ObservableFloatArray src)
Appends content of a given observable array to the end of this array.
|
void |
addAll(ObservableFloatArray src,
int srcIndex,
int length)
Appends a portion of given observable array to the end of this array.
|
private void |
addAllInternal(float[] src,
int srcIndex,
int length) |
private void |
addAllInternal(ObservableFloatArray src,
int srcIndex,
int length) |
void |
clear()
Empties the array by resizing it to 0.
|
void |
copyTo(int srcIndex,
float[] dest,
int destIndex,
int length)
Copies specified portion of array into
dest array. |
void |
copyTo(int srcIndex,
ObservableFloatArray dest,
int destIndex,
int length)
Copies specified portion of array into
dest observable array. |
void |
ensureCapacity(int capacity)
Grows the capacity of this array if the current capacity is less than
given
capacity, does nothing if it already exceeds
the capacity. |
float |
get(int index)
Gets a single value of array.
|
private void |
growCapacity(int length) |
private static int |
hugeCapacity(int minCapacity) |
private void |
rangeCheck(float[] src,
int srcIndex,
int length) |
private void |
rangeCheck(int size) |
private void |
rangeCheck(ObservableFloatArray src,
int srcIndex,
int length) |
void |
resize(int newSize)
Sets new length of data in this array.
|
void |
set(int index,
float value)
Sets a single value in the array.
|
void |
set(int destIndex,
float[] src,
int srcIndex,
int length)
Copies a portion of specified array into this observable array.
|
void |
set(int destIndex,
ObservableFloatArray src,
int srcIndex,
int length)
Copies a portion of specified observable array into this observable array.
|
void |
setAll(float[] src)
Replaces this observable array content with given elements.
|
void |
setAll(float[] src,
int srcIndex,
int length)
Replaces this observable array content with a copy of portion of
a given array.
|
void |
setAll(ObservableFloatArray src)
Replaces this observable array content with a copy of given observable array.
|
void |
setAll(ObservableFloatArray src,
int srcIndex,
int length)
Replaces this observable array content with a portion of a given
observable array.
|
private void |
setAllInternal(float[] src,
int srcIndex,
int length) |
private void |
setAllInternal(ObservableFloatArray src,
int srcIndex,
int length) |
int |
size()
Retrieves length of data in this array.
|
float[] |
toArray(float[] dest)
Returns an array containing copy of the observable array.
|
float[] |
toArray(int index,
float[] dest,
int length)
Returns an array containing copy of specified portion of the observable array.
|
java.lang.String |
toString() |
void |
trimToSize()
Shrinks the capacity to the current size of data in the array.
|
addListener, addListener, fireChange, removeListener, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, removeListeneraddListener, removeListenerprivate static final float[] INITIAL
private float[] array
private int size
private static final int MAX_ARRAY_SIZE
public ObservableFloatArrayImpl()
public ObservableFloatArrayImpl(float... elements)
elements - initial values to copy to observable float arraypublic ObservableFloatArrayImpl(ObservableFloatArray src)
src - observable float array to copypublic void clear()
ObservableArrayclear in interface ObservableArray<ObservableFloatArray>ObservableArray.trimToSize()public int size()
ObservableArraysize in interface ObservableArray<ObservableFloatArray>private void addAllInternal(ObservableFloatArray src, int srcIndex, int length)
private void addAllInternal(float[] src,
int srcIndex,
int length)
public void addAll(ObservableFloatArray src)
ObservableFloatArrayaddAll in interface ObservableFloatArraysrc - observable array with elements to appendpublic void addAll(float... elements)
ObservableFloatArrayelements to the end of this array. Capacity is increased
if necessary to match the new size of the data.addAll in interface ObservableFloatArrayelements - elements to appendpublic void addAll(ObservableFloatArray src, int srcIndex, int length)
ObservableFloatArrayaddAll in interface ObservableFloatArraysrc - source observable arraysrcIndex - starting position in source arraylength - length of portion to appendpublic void addAll(float[] src,
int srcIndex,
int length)
ObservableFloatArrayaddAll in interface ObservableFloatArraysrc - source arraysrcIndex - starting position in source arraylength - length of portion to appendprivate void setAllInternal(ObservableFloatArray src, int srcIndex, int length)
private void setAllInternal(float[] src,
int srcIndex,
int length)
public void setAll(ObservableFloatArray src)
ObservableFloatArraysetAll in interface ObservableFloatArraysrc - source observable array to copy.public void setAll(ObservableFloatArray src, int srcIndex, int length)
ObservableFloatArraysetAll in interface ObservableFloatArraysrc - source observable array to copy.srcIndex - starting position in source observable arraylength - length of a portion to copypublic void setAll(float[] src,
int srcIndex,
int length)
ObservableFloatArraysetAll in interface ObservableFloatArraysrc - source array to copy.srcIndex - starting position in source observable arraylength - length of a portion to copypublic void setAll(float[] src)
ObservableFloatArraysetAll in interface ObservableFloatArraysrc - elements to put into array contentpublic void set(int destIndex,
float[] src,
int srcIndex,
int length)
ObservableFloatArraySystem.arraycopy() method.set in interface ObservableFloatArraydestIndex - the starting destination position in this observable arraysrc - source array to copysrcIndex - starting position in source arraylength - length of portion to copypublic void set(int destIndex,
ObservableFloatArray src,
int srcIndex,
int length)
ObservableFloatArraySystem.arraycopy() method.set in interface ObservableFloatArraydestIndex - the starting destination position in this observable arraysrc - source observable array to copysrcIndex - starting position in source arraylength - length of portion to copypublic float[] toArray(float[] dest)
ObservableFloatArraytoArray in interface ObservableFloatArraydest - the array into which the observable array to be copied,
if it is big enough; otherwise, a new float array is allocated.
Ignored, if null.public float get(int index)
ObservableFloatArrayget in interface ObservableFloatArrayindex - index of element to getpublic void set(int index,
float value)
ObservableFloatArrayset in interface ObservableFloatArrayindex - index of the value to setvalue - new value for the given indexpublic float[] toArray(int index,
float[] dest,
int length)
ObservableFloatArraytoArray in interface ObservableFloatArrayindex - starting position in the observable arraydest - the array into which specified portion of the observable array
to be copied, if it is big enough;
otherwise, a new float array is allocated.
Ignored, if null.length - length of portion to copypublic void copyTo(int srcIndex,
float[] dest,
int destIndex,
int length)
ObservableFloatArraydest array. Throws
the same exceptions as System.arraycopy() method.copyTo in interface ObservableFloatArraysrcIndex - starting position in the observable arraydest - destination arraydestIndex - starting position in destination arraylength - length of portion to copypublic void copyTo(int srcIndex,
ObservableFloatArray dest,
int destIndex,
int length)
ObservableFloatArraydest observable array.
Throws the same exceptions as System.arraycopy() method.copyTo in interface ObservableFloatArraysrcIndex - starting position in the observable arraydest - destination observable arraydestIndex - starting position in destination observable arraylength - length of portion to copypublic void resize(int newSize)
ObservableArrayresize in interface ObservableArray<ObservableFloatArray>newSize - new length of data in this arrayprivate void growCapacity(int length)
public void ensureCapacity(int capacity)
ObservableArraycapacity, does nothing if it already exceeds
the capacity.ensureCapacity in interface ObservableArray<ObservableFloatArray>private static int hugeCapacity(int minCapacity)
public void trimToSize()
ObservableArraytrimToSize in interface ObservableArray<ObservableFloatArray>private void rangeCheck(int size)
private void rangeCheck(ObservableFloatArray src, int srcIndex, int length)
private void rangeCheck(float[] src,
int srcIndex,
int length)
public java.lang.String toString()
toString in class java.lang.Object