Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method
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.
Method Details
void copyTo (int srcIndex,
int[] dest,
int destIndex,
int length)
Copies specified portion of array into
dest
array. Throws
the same exceptions as
System.arraycopy()
method.
Parameters:
srcIndex
- starting position in the observable array
dest
- destination array
destIndex
- starting position in destination array
length
- length of portion to copy
Copies specified portion of array into
dest
observable array.
Throws the same exceptions as
System.arraycopy()
method.
Parameters:
srcIndex
- starting position in the observable array
dest
- destination observable array
destIndex
- starting position in destination observable array
length
- length of portion to copy
int get (int index)
Gets a single value of array. This is generally as fast as direct access
to an array and eliminates necessity to make a copy of array.
Parameters:
index
- index of element to get
Returns:
value at the given index
Throws:
ArrayIndexOutOfBoundsException
- if index
is outside
array bounds
void addAll (int... elements)
Appends given elements
to the end of this array. Capacity is increased
if necessary to match the new size of the data.
Parameters:
elements
- elements to append
Appends content of a given observable array to the end of this array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- observable array with elements to append
void addAll (int[] src,
int srcIndex,
int length)
Appends a portion of given array to the end of this array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- source array
srcIndex
- starting position in source array
length
- length of portion to append
Appends a portion of given observable array to the end of this array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- source observable array
srcIndex
- starting position in source array
length
- length of portion to append
void setAll (int... elements)
Replaces this observable array content with given elements.
Capacity is increased if necessary to match the new size of the data.
Parameters:
elements
- elements to put into array content
Throws:
NullPointerException
- if src
is null
void setAll (int[] src,
int srcIndex,
int length)
Replaces this observable array content with a copy of portion of
a given array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- source array to copy.
srcIndex
- starting position in source observable array
length
- length of a portion to copy
Throws:
NullPointerException
- if src
is null
Replaces this observable array content with a copy of given observable array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- source observable array to copy.
Throws:
NullPointerException
- if src
is null
Replaces this observable array content with a portion of a given
observable array.
Capacity is increased if necessary to match the new size of the data.
Parameters:
src
- source observable array to copy.
srcIndex
- starting position in source observable array
length
- length of a portion to copy
Throws:
NullPointerException
- if src
is null
void set (int destIndex,
int[] src,
int srcIndex,
int length)
Copies a portion of specified array into this observable array. Throws
the same exceptions as
System.arraycopy()
method.
Parameters:
destIndex
- the starting destination position in this observable array
src
- source array to copy
srcIndex
- starting position in source array
length
- length of portion to copy
Copies a portion of specified observable array into this observable array.
Throws the same exceptions as
System.arraycopy()
method.
Parameters:
destIndex
- the starting destination position in this observable array
src
- source observable array to copy
srcIndex
- starting position in source array
length
- length of portion to copy
void set (int index,
int value)
Sets a single value in the array. Avoid using this method if many values
are updated, use
set(int, int[], int, int) update method
instead with as minimum number of invocations as possible.
Parameters:
index
- index of the value to set
value
- new value for the given index
Throws:
ArrayIndexOutOfBoundsException
- if index
is outside
array bounds
int[] toArray (int[] dest)
Returns an array containing copy of the observable array.
If the observable array fits in the specified array, it is copied therein.
Otherwise, a new array is allocated with the size of the observable array.
Parameters:
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.
Returns:
an int array containing the 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.
If specified portion of the observable array fits in the specified array,
it is copied therein. Otherwise, a new array of given length is allocated.
Parameters:
srcIndex
- starting position in the observable array
dest
- 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 copy
Returns:
an int array containing the copy of specified portion the observable array