Top Fields Constructors Methods
com.sun.javafx.collections

public Class ImmutableObservableList<E>

extends AbstractList<E>
implements ObservableList<E>
Class Inheritance
All Implemented Interfaces
javafx.collections.ObservableList, javafx.beans.Observable, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Imports
java.util.AbstractList, .Arrays, .Collection, javafx.beans.InvalidationListener, javafx.collections.ListChangeListener, .ObservableList

Field Summary

Modifier and TypeField and Description
private final E[]
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
ImmutableObservableList(E... elements)

Method Summary

Modifier and TypeMethod and Description
public boolean
addAll(E...
the elements to add
elements
)

Implements javafx.collections.ObservableList.addAll.

A convenience method for var-arg addition of elements.

public void
addListener(InvalidationListener
The listener to register
listener
)

Implements javafx.beans.Observable.addListener.

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

public void
addListener(ListChangeListener<? super E>
the listener for listening to the list changes
listener
)

Implements javafx.collections.ObservableList.addListener.

Add a listener to this observable list.

public E
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public void
remove(int
the start of the range to remove (inclusive)
from
,
int
the end of the range to remove (exclusive)
to
)

Implements javafx.collections.ObservableList.remove.

A simplified way of calling sublist(from, to).clear().

public boolean
removeAll(E...
the elements to be removed
elements
)

Implements javafx.collections.ObservableList.removeAll.

A convenience method for var-arg usage of the removeAll method.

public void
removeListener(InvalidationListener
The listener to remove
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 void
removeListener(ListChangeListener<? super E>
a listener to remove
listener
)

Implements javafx.collections.ObservableList.removeListener.

Tries to remove a listener from this observable list.

public boolean
retainAll(E...
the elements to be retained
elements
)

Implements javafx.collections.ObservableList.retainAll.

A convenience method for var-arg usage of the retainAll method.

public boolean
setAll(E...
the elements to set
elements
)

Implements javafx.collections.ObservableList.setAll.

Clears the ObservableList and adds all the elements passed as var-args.

public boolean
setAll(Collection<? extends E>
the collection with elements that will be added to this observableArrayList
col
)

Implements javafx.collections.ObservableList.setAll.

Clears the ObservableList and adds all elements from the collection.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

elementsback to summary
private final E[] elements

Constructor Detail

ImmutableObservableListback to summary
public ImmutableObservableList(E... elements)

Method Detail

addAllback to summary
public boolean addAll(E... elements)

Implements javafx.collections.ObservableList.addAll.

Doc from javafx.collections.ObservableList.addAll.

A convenience method for var-arg addition of elements.

Parameters
elements:E[]

the elements to add

Returns:boolean

true (as specified by Collection.add(E))

Annotations
@Override
addListenerback to summary
public 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.

Parameters
listener:InvalidationListener

The listener to register

Annotations
@Override
addListenerback to summary
public void addListener(ListChangeListener<? super E> listener)

Implements javafx.collections.ObservableList.addListener.

Doc from javafx.collections.ObservableList.addListener.

Add a listener to this observable list.

Parameters
listener:ListChangeListener<? super E>

the listener for listening to the list changes

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

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:E

the element at the specified position in this list

Annotations
@Override
removeback to summary
public void remove(int from, int to)

Implements javafx.collections.ObservableList.remove.

Doc from javafx.collections.ObservableList.remove.

A simplified way of calling sublist(from, to).clear(). As this is a common operation, ObservableList has this method for convenient usage.

Parameters
from:int

the start of the range to remove (inclusive)

to:int

the end of the range to remove (exclusive)

Annotations
@Override
removeAllback to summary
public boolean removeAll(E... elements)

Implements javafx.collections.ObservableList.removeAll.

Doc from javafx.collections.ObservableList.removeAll.

A convenience method for var-arg usage of the removeAll method.

Parameters
elements:E[]

the elements to be removed

Returns:boolean

true if list changed as a result of this call

Annotations
@Override
removeListenerback to summary
public 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.

Parameters
listener:InvalidationListener

The listener to remove

Annotations
@Override
removeListenerback to summary
public void removeListener(ListChangeListener<? super E> listener)

Implements javafx.collections.ObservableList.removeListener.

Doc from javafx.collections.ObservableList.removeListener.

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

Parameters
listener:ListChangeListener<? super E>

a listener to remove

Annotations
@Override
retainAllback to summary
public boolean retainAll(E... elements)

Implements javafx.collections.ObservableList.retainAll.

Doc from javafx.collections.ObservableList.retainAll.

A convenience method for var-arg usage of the retainAll method.

Parameters
elements:E[]

the elements to be retained

Returns:boolean

true if list changed as a result of this call

Annotations
@Override
setAllback to summary
public boolean setAll(E... elements)

Implements javafx.collections.ObservableList.setAll.

Doc from javafx.collections.ObservableList.setAll.

Clears the ObservableList and adds all the elements passed as var-args.

Parameters
elements:E[]

the elements to set

Returns:boolean

true (as specified by Collection.add(E))

Annotations
@Override
setAllback to summary
public boolean setAll(Collection<? extends E> col)

Implements javafx.collections.ObservableList.setAll.

Doc from javafx.collections.ObservableList.setAll.

Clears the ObservableList and adds all elements from the collection.

Parameters
col:Collection<? extends E>

the collection with elements that will be added to this observableArrayList

Returns:boolean

true (as specified by Collection.add(E))

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override