Top Description Fields Constructors Methods
javafx.collections

public abstract Class ObservableArrayBase<T extends ObservableArray<T>>

extends Object
implements ObservableArray<T extends ObservableArray<T>>
Class Inheritance
All Implemented Interfaces
javafx.collections.ObservableArray, javafx.beans.Observable
Known Direct Subclasses
com.sun.javafx.collections.ObservableFloatArrayImpl, com.sun.javafx.collections.ObservableIntegerArrayImpl
Type Parameters
<T>
actual array instance type
Imports
com.sun.javafx.collections.ArrayListenerHelper, javafx.beans.InvalidationListener

Abstract class that serves as a base class for ObservableArray implementations. The base class provides listener handling functionality by implementing addListener and removeListener methods. fireChange(boolean, int, int) method is provided for notifying the listeners.
Since
JavaFX 8.0
See Also
ObservableArray, ArrayChangeListener

Field Summary

Modifier and TypeField and Description
private ArrayListenerHelper<T>

Constructor Summary

AccessConstructor and Description
public
ObservableArrayBase()

Creates a default ObservableArrayBase.

Method Summary

Modifier and TypeMethod and Description
public final void
addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid.

public final void
addListener(ArrayChangeListener<T> listener)

Implements javafx.collections.ObservableArray.addListener.

Add a listener to this observable array.

protected final void
fireChange(boolean
indicates size of array changed
sizeChanged
,
int
A beginning (inclusive) of an interval related to the change
from
,
int
An end (exclusive) of an interval related to the change.
to
)

Notifies all listeners of a change

public final void
removeListener(InvalidationListener listener)

Implements javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

public final void
removeListener(ArrayChangeListener<T> listener)

Implements javafx.collections.ObservableArray.removeListener.

Tries to remove a listener from this observable array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listenerHelperback to summary
private ArrayListenerHelper<T> listenerHelper

Constructor Detail

ObservableArrayBaseback to summary
public ObservableArrayBase()

Creates a default ObservableArrayBase.

Method Detail

addListenerback to summary
public final void addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

Doc from javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual InvalidationListener instance may be safely registered for different Observables.

The Observable stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakInvalidationListener avoid this situation.

Annotations
@Override
addListenerback to summary
public final void addListener(ArrayChangeListener<T> listener)

Implements javafx.collections.ObservableArray.addListener.

Doc from javafx.collections.ObservableArray.addListener.

Add a listener to this observable array.

Annotations
@Override
fireChangeback to summary
protected final void fireChange(boolean sizeChanged, int from, int to)

Notifies all listeners of a change

Parameters
sizeChanged:boolean

indicates size of array changed

from:int

A beginning (inclusive) of an interval related to the change

to:int

An end (exclusive) of an interval related to the change.

removeListenerback to summary
public final void removeListener(InvalidationListener listener)

Implements javafx.beans.Observable.removeListener.

Doc from javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Annotations
@Override
removeListenerback to summary
public final void removeListener(ArrayChangeListener<T> listener)

Implements javafx.collections.ObservableArray.removeListener.

Doc from javafx.collections.ObservableArray.removeListener.

Tries to remove a listener from this observable array. If the listener is not attached to this array, nothing happens.

Annotations
@Override