public interface ObservableFloatArray extends ObservableArray<ObservableFloatArray>
ObservableFloatArray
is a float[]
array that allows listeners
to track changes when they occur. In order to track changes, the internal
array is encapsulated and there is no direct access available from the outside.
Bulk operations are supported but they always do a copy of the data range.ArrayChangeListener
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.
|
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. |
float |
get(int index)
Gets a single value of 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... elements)
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.
|
float[] |
toArray(float[] dest)
Returns an array containing copy of the observable array.
|
float[] |
toArray(int srcIndex,
float[] dest,
int length)
Returns an array containing copy of specified portion of the observable array.
|
addListener, clear, ensureCapacity, removeListener, resize, size, trimToSize
addListener, removeListener
void copyTo(int srcIndex, float[] dest, int destIndex, int length)
dest
array. Throws
the same exceptions as System.arraycopy()
method.srcIndex
- starting position in the observable arraydest
- destination arraydestIndex
- starting position in destination arraylength
- length of portion to copyvoid copyTo(int srcIndex, ObservableFloatArray dest, int destIndex, int length)
dest
observable array.
Throws the same exceptions as System.arraycopy()
method.srcIndex
- starting position in the observable arraydest
- destination observable arraydestIndex
- starting position in destination observable arraylength
- length of portion to copyfloat get(int index)
index
- index of element to getArrayIndexOutOfBoundsException
- if index
is outside
array boundsvoid addAll(float... elements)
elements
to the end of this array. Capacity is increased
if necessary to match the new size of the data.elements
- elements to appendvoid addAll(ObservableFloatArray src)
src
- observable array with elements to appendvoid addAll(float[] src, int srcIndex, int length)
src
- source arraysrcIndex
- starting position in source arraylength
- length of portion to appendvoid addAll(ObservableFloatArray src, int srcIndex, int length)
src
- source observable arraysrcIndex
- starting position in source arraylength
- length of portion to appendvoid setAll(float... elements)
elements
- elements to put into array contentNullPointerException
- if src
is nullvoid setAll(float[] src, int srcIndex, int length)
src
- source array to copy.srcIndex
- starting position in source observable arraylength
- length of a portion to copyNullPointerException
- if src
is nullvoid setAll(ObservableFloatArray src)
src
- source observable array to copy.NullPointerException
- if src
is nullvoid setAll(ObservableFloatArray src, int srcIndex, int length)
src
- source observable array to copy.srcIndex
- starting position in source observable arraylength
- length of a portion to copyNullPointerException
- if src
is nullvoid set(int destIndex, float[] src, int srcIndex, int length)
System.arraycopy()
method.destIndex
- the starting destination position in this observable arraysrc
- source array to copysrcIndex
- starting position in source arraylength
- length of portion to copyvoid set(int destIndex, ObservableFloatArray src, int srcIndex, int length)
System.arraycopy()
method.destIndex
- the starting destination position in this observable arraysrc
- source observable array to copysrcIndex
- starting position in source arraylength
- length of portion to copyvoid set(int index, float value)
index
- index of the value to setvalue
- new value for the given indexArrayIndexOutOfBoundsException
- if index
is outside
array boundsfloat[] toArray(float[] dest)
dest
- 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.float[] toArray(int srcIndex, float[] dest, int length)
srcIndex
- 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 copySubmit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.