public interface ObservableIntegerArray extends ObservableArray<ObservableIntegerArray>
ObservableIntegerArray
is a int[]
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(int... elements)
Appends given
elements to the end of this array. |
void |
addAll(int[] src,
int srcIndex,
int length)
Appends a portion of given array to the end of this array.
|
void |
addAll(ObservableIntegerArray src)
Appends content of a given observable array to the end of this array.
|
void |
addAll(ObservableIntegerArray src,
int srcIndex,
int length)
Appends a portion of given observable array to the end of this array.
|
void |
copyTo(int srcIndex,
int[] dest,
int destIndex,
int length)
Copies specified portion of array into
dest array. |
void |
copyTo(int srcIndex,
ObservableIntegerArray dest,
int destIndex,
int length)
Copies specified portion of array into
dest observable array. |
int |
get(int index)
Gets a single value of array.
|
void |
set(int index,
int value)
Sets a single value in the array.
|
void |
set(int destIndex,
int[] src,
int srcIndex,
int length)
Copies a portion of specified array into this observable array.
|
void |
set(int destIndex,
ObservableIntegerArray src,
int srcIndex,
int length)
Copies a portion of specified observable array into this observable array.
|
void |
setAll(int... elements)
Replaces this observable array content with given elements.
|
void |
setAll(int[] src,
int srcIndex,
int length)
Replaces this observable array content with a copy of portion of
a given array.
|
void |
setAll(ObservableIntegerArray src)
Replaces this observable array content with a copy of given observable array.
|
void |
setAll(ObservableIntegerArray src,
int srcIndex,
int length)
Replaces this observable array content with a portion of a given
observable array.
|
int[] |
toArray(int[] dest)
Returns an array containing copy of the observable array.
|
int[] |
toArray(int srcIndex,
int[] 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, int[] 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, ObservableIntegerArray 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 copyint get(int index)
index
- index of element to getArrayIndexOutOfBoundsException
- if index
is outside
array boundsvoid addAll(int... 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(ObservableIntegerArray src)
src
- observable array with elements to appendvoid addAll(int[] src, int srcIndex, int length)
src
- source arraysrcIndex
- starting position in source arraylength
- length of portion to appendvoid addAll(ObservableIntegerArray src, int srcIndex, int length)
src
- source observable arraysrcIndex
- starting position in source arraylength
- length of portion to appendvoid setAll(int... elements)
elements
- elements to put into array contentNullPointerException
- if src
is nullvoid setAll(int[] 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(ObservableIntegerArray src)
src
- source observable array to copy.NullPointerException
- if src
is nullvoid setAll(ObservableIntegerArray 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, int[] 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, ObservableIntegerArray 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, int value)
index
- index of the value to setvalue
- new value for the given indexArrayIndexOutOfBoundsException
- if index
is outside
array boundsint[] toArray(int[] dest)
dest
- the array into which the observable array to be copied,
if it is big enough; otherwise, a new int array is allocated.
Ignored, if null.int[] toArray(int srcIndex, int[] 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 int 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, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.