Top Description Fields Constructors Methods
com.sun.javafx.collections

public Class ObservableIntegerArrayImpl

extends ObservableArrayBase<ObservableIntegerArray>
implements ObservableIntegerArray
Class Inheritance
All Implemented Interfaces
javafx.collections.ObservableIntegerArray, javafx.collections.ObservableArray, javafx.beans.Observable
Imports
java.util.Arrays, javafx.collections.ObservableArrayBase, .ObservableIntegerArray

ObservableIntegerArray default implementation.

Field Summary

Modifier and TypeField and Description
private int[]
private static final int[]
private static final int
MAX_ARRAY_SIZE

The maximum size of array to allocate.

private int

Constructor Summary

AccessConstructor and Description
public
ObservableIntegerArrayImpl()

Creates empty observable integer array

public
ObservableIntegerArrayImpl(int...
initial values to copy to observable integer array
elements
)

Creates observable integer array with copy of given initial values

public
ObservableIntegerArrayImpl(ObservableIntegerArray
observable integer array to copy
src
)

Creates observable integer array with copy of given observable integer array

Method Summary

Modifier and TypeMethod and Description
public void
addAll(ObservableIntegerArray
observable array with elements to append
src
)

Implements javafx.collections.ObservableIntegerArray.addAll.

Appends content of a given observable array to the end of this array.

public void
addAll(int...
elements to append
elements
)

Implements javafx.collections.ObservableIntegerArray.addAll.

Appends given elements to the end of this array.

public void
addAll(ObservableIntegerArray
source observable array
src
,
int
starting position in source array
srcIndex
,
int
length of portion to append
length
)

Implements javafx.collections.ObservableIntegerArray.addAll.

Appends a portion of given observable array to the end of this array.

public void
addAll(int[]
source array
src
,
int
starting position in source array
srcIndex
,
int
length of portion to append
length
)

Implements javafx.collections.ObservableIntegerArray.addAll.

Appends a portion of given array to the end of this array.

private void
addAllInternal(ObservableIntegerArray src, int srcIndex, int length)

private void
addAllInternal(int[] src, int srcIndex, int length)

public void
clear()

Implements javafx.collections.ObservableArray.clear.

Empties the array by resizing it to 0.

public void
copyTo(int
starting position in the observable array
srcIndex
,
int[]
destination array
dest
,
int
starting position in destination array
destIndex
,
int
length of portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.copyTo.

Copies specified portion of array into dest array.

public void
copyTo(int
starting position in the observable array
srcIndex
,
ObservableIntegerArray
destination observable array
dest
,
int
starting position in destination observable array
destIndex
,
int
length of portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.copyTo.

Copies specified portion of array into dest observable array.

public void
ensureCapacity(int
the capacity of this array
capacity
)

Implements javafx.collections.ObservableArray.ensureCapacity.

Grows the capacity of this array if the current capacity is less than given capacity, does nothing if it already exceeds the capacity.

public int
get(int
index of element to get
index
)

Implements javafx.collections.ObservableIntegerArray.get.

Gets a single value of array.

private void
growCapacity(int length)

private static int
hugeCapacity(int minCapacity)

private void
rangeCheck(int size)

private void
rangeCheck(ObservableIntegerArray src, int srcIndex, int length)

private void
rangeCheck(int[] src, int srcIndex, int length)

public void
resize(int
new length of data in this array
newSize
)

Implements javafx.collections.ObservableArray.resize.

Sets new length of data in this array.

public void
set(int
the starting destination position in this observable array
destIndex
,
int[]
source array to copy
src
,
int
starting position in source array
srcIndex
,
int
length of portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.set.

Copies a portion of specified array into this observable array.

public void
set(int
the starting destination position in this observable array
destIndex
,
ObservableIntegerArray
source observable array to copy
src
,
int
starting position in source array
srcIndex
,
int
length of portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.set.

Copies a portion of specified observable array into this observable array.

public void
set(int
index of the value to set
index
,
int
new value for the given index
value
)

Implements javafx.collections.ObservableIntegerArray.set.

Sets a single value in the array.

public void
setAll(ObservableIntegerArray
source observable array to copy.
src
)

Implements javafx.collections.ObservableIntegerArray.setAll.

Replaces this observable array content with a copy of given observable array.

public void
setAll(ObservableIntegerArray
source observable array to copy.
src
,
int
starting position in source observable array
srcIndex
,
int
length of a portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.setAll.

Replaces this observable array content with a portion of a given observable array.

public void
setAll(int[]
source array to copy.
src
,
int
starting position in source observable array
srcIndex
,
int
length of a portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.setAll.

Replaces this observable array content with a copy of portion of a given array.

public void
setAll(int...
elements to put into array content
src
)

Implements javafx.collections.ObservableIntegerArray.setAll.

Replaces this observable array content with given elements.

private void
setAllInternal(ObservableIntegerArray src, int srcIndex, int length)

private void
setAllInternal(int[] src, int srcIndex, int length)

public int
size()

Implements javafx.collections.ObservableArray.size.

Retrieves length of data in this array.

public int[]
toArray(int[]
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.
dest
)

Implements javafx.collections.ObservableIntegerArray.toArray.

Returns an array containing copy of the observable array.

public int[]
toArray(int
starting position in the observable array
index
,
int[]
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.
dest
,
int
length of portion to copy
length
)

Implements javafx.collections.ObservableIntegerArray.toArray.

Returns an array containing copy of specified portion of the observable array.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
trimToSize()

Implements javafx.collections.ObservableArray.trimToSize.

Shrinks the capacity to the current size of data in the array.

Inherited from javafx.collections.ObservableArrayBase:
addListeneraddListenerfireChangeremoveListenerremoveListener

Field Detail

arrayback to summary
private int[] array
INITIALback to summary
private static final int[] INITIAL
MAX_ARRAY_SIZEback to summary
private static final int MAX_ARRAY_SIZE

The maximum size of array to allocate. Some VMs reserve some header words in an array. Attempts to allocate larger arrays may result in OutOfMemoryError: Requested array size exceeds VM limit

sizeback to summary
private int size

Constructor Detail

ObservableIntegerArrayImplback to summary
public ObservableIntegerArrayImpl()

Creates empty observable integer array

ObservableIntegerArrayImplback to summary
public ObservableIntegerArrayImpl(int... elements)

Creates observable integer array with copy of given initial values

Parameters
elements:int[]

initial values to copy to observable integer array

ObservableIntegerArrayImplback to summary
public ObservableIntegerArrayImpl(ObservableIntegerArray src)

Creates observable integer array with copy of given observable integer array

Parameters
src:ObservableIntegerArray

observable integer array to copy

Method Detail

addAllback to summary
public void addAll(ObservableIntegerArray src)

Implements javafx.collections.ObservableIntegerArray.addAll.

Doc from javafx.collections.ObservableIntegerArray.addAll.

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:ObservableIntegerArray

observable array with elements to append

Annotations
@Override
addAllback to summary
public void addAll(int... elements)

Implements javafx.collections.ObservableIntegerArray.addAll.

Doc from javafx.collections.ObservableIntegerArray.addAll.

Appends given elements to the end of this array. Capacity is increased if necessary to match the new size of the data.

Parameters
elements:int[]

elements to append

Annotations
@Override
addAllback to summary
public void addAll(ObservableIntegerArray src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.addAll.

Doc from javafx.collections.ObservableIntegerArray.addAll.

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:ObservableIntegerArray

source observable array

srcIndex:int

starting position in source array

length:int

length of portion to append

Annotations
@Override
addAllback to summary
public void addAll(int[] src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.addAll.

Doc from javafx.collections.ObservableIntegerArray.addAll.

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:int[]

source array

srcIndex:int

starting position in source array

length:int

length of portion to append

Annotations
@Override
addAllInternalback to summary
private void addAllInternal(ObservableIntegerArray src, int srcIndex, int length)
addAllInternalback to summary
private void addAllInternal(int[] src, int srcIndex, int length)
clearback to summary
public void clear()

Implements javafx.collections.ObservableArray.clear.

Doc from javafx.collections.ObservableArray.clear.

Empties the array by resizing it to 0. Capacity is not changed.

Annotations
@Override
copyToback to summary
public void copyTo(int srcIndex, int[] dest, int destIndex, int length)

Implements javafx.collections.ObservableIntegerArray.copyTo.

Doc from javafx.collections.ObservableIntegerArray.copyTo.

Copies specified portion of array into dest array. Throws the same exceptions as System.arraycopy() method.

Parameters
srcIndex:int

starting position in the observable array

dest:int[]

destination array

destIndex:int

starting position in destination array

length:int

length of portion to copy

Annotations
@Override
copyToback to summary
public void copyTo(int srcIndex, ObservableIntegerArray dest, int destIndex, int length)

Implements javafx.collections.ObservableIntegerArray.copyTo.

Doc from javafx.collections.ObservableIntegerArray.copyTo.

Copies specified portion of array into dest observable array. Throws the same exceptions as System.arraycopy() method.

Parameters
srcIndex:int

starting position in the observable array

dest:ObservableIntegerArray

destination observable array

destIndex:int

starting position in destination observable array

length:int

length of portion to copy

Annotations
@Override
ensureCapacityback to summary
public void ensureCapacity(int capacity)

Implements javafx.collections.ObservableArray.ensureCapacity.

Doc from javafx.collections.ObservableArray.ensureCapacity.

Grows the capacity of this array if the current capacity is less than given capacity, does nothing if it already exceeds the capacity.

Parameters
capacity:int

the capacity of this array

Annotations
@Override
getback to summary
public int get(int index)

Implements javafx.collections.ObservableIntegerArray.get.

Doc from javafx.collections.ObservableIntegerArray.get.

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:int

index of element to get

Returns:int

value at the given index

Annotations
@Override
growCapacityback to summary
private void growCapacity(int length)
hugeCapacityback to summary
private static int hugeCapacity(int minCapacity)
rangeCheckback to summary
private void rangeCheck(int size)
rangeCheckback to summary
private void rangeCheck(ObservableIntegerArray src, int srcIndex, int length)
rangeCheckback to summary
private void rangeCheck(int[] src, int srcIndex, int length)
resizeback to summary
public void resize(int newSize)

Implements javafx.collections.ObservableArray.resize.

Doc from javafx.collections.ObservableArray.resize.

Sets new length of data in this array. This method grows capacity if necessary but never shrinks it. Resulting array will contain existing data for indexes that are less than the current size and zeroes for indexes that are greater than the current size.

Parameters
newSize:int

new length of data in this array

Annotations
@Override
setback to summary
public void set(int destIndex, int[] src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.set.

Doc from javafx.collections.ObservableIntegerArray.set.

Copies a portion of specified array into this observable array. Throws the same exceptions as System.arraycopy() method.

Parameters
destIndex:int

the starting destination position in this observable array

src:int[]

source array to copy

srcIndex:int

starting position in source array

length:int

length of portion to copy

Annotations
@Override
setback to summary
public void set(int destIndex, ObservableIntegerArray src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.set.

Doc from javafx.collections.ObservableIntegerArray.set.

Copies a portion of specified observable array into this observable array. Throws the same exceptions as System.arraycopy() method.

Parameters
destIndex:int

the starting destination position in this observable array

src:ObservableIntegerArray

source observable array to copy

srcIndex:int

starting position in source array

length:int

length of portion to copy

Annotations
@Override
setback to summary
public void set(int index, int value)

Implements javafx.collections.ObservableIntegerArray.set.

Doc from javafx.collections.ObservableIntegerArray.set.

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:int

index of the value to set

value:int

new value for the given index

Annotations
@Override
setAllback to summary
public void setAll(ObservableIntegerArray src)

Implements javafx.collections.ObservableIntegerArray.setAll.

Doc from javafx.collections.ObservableIntegerArray.setAll.

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:ObservableIntegerArray

source observable array to copy.

Annotations
@Override
setAllback to summary
public void setAll(ObservableIntegerArray src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.setAll.

Doc from javafx.collections.ObservableIntegerArray.setAll.

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:ObservableIntegerArray

source observable array to copy.

srcIndex:int

starting position in source observable array

length:int

length of a portion to copy

Annotations
@Override
setAllback to summary
public void setAll(int[] src, int srcIndex, int length)

Implements javafx.collections.ObservableIntegerArray.setAll.

Doc from javafx.collections.ObservableIntegerArray.setAll.

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:int[]

source array to copy.

srcIndex:int

starting position in source observable array

length:int

length of a portion to copy

Annotations
@Override
setAllback to summary
public void setAll(int... src)

Implements javafx.collections.ObservableIntegerArray.setAll.

Doc from javafx.collections.ObservableIntegerArray.setAll.

Replaces this observable array content with given elements. Capacity is increased if necessary to match the new size of the data.

Parameters
src:int[]

elements to put into array content

Annotations
@Override
setAllInternalback to summary
private void setAllInternal(ObservableIntegerArray src, int srcIndex, int length)
setAllInternalback to summary
private void setAllInternal(int[] src, int srcIndex, int length)
sizeback to summary
public int size()

Implements javafx.collections.ObservableArray.size.

Doc from javafx.collections.ObservableArray.size.

Retrieves length of data in this array.

Returns:int

length of data in this array

Annotations
@Override
toArrayback to summary
public int[] toArray(int[] dest)

Implements javafx.collections.ObservableIntegerArray.toArray.

Doc from javafx.collections.ObservableIntegerArray.toArray.

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:int[]

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:int[]

an int array containing the copy of the observable array

Annotations
@Override
toArrayback to summary
public int[] toArray(int index, int[] dest, int length)

Implements javafx.collections.ObservableIntegerArray.toArray.

Doc from javafx.collections.ObservableIntegerArray.toArray.

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
index:int

starting position in the observable array

dest:int[]

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:int

length of portion to copy

Returns:int[]

an int array containing the copy of specified portion the observable array

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
trimToSizeback to summary
public void trimToSize()

Implements javafx.collections.ObservableArray.trimToSize.

Doc from javafx.collections.ObservableArray.trimToSize.

Shrinks the capacity to the current size of data in the array.

Annotations
@Override