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... elements)

Implements javafx.collections.ObservableList.addAll.

A convenience method for var-arg addition of elements.

public void
addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

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

public void
addListener(ListChangeListener<? super E> listener)

Implements javafx.collections.ObservableList.addListener.

Add a listener to this observable list.

public E
get(int 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 from, int to)

Implements javafx.collections.ObservableList.remove.

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

public boolean
removeAll(E... elements)

Implements javafx.collections.ObservableList.removeAll.

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

public 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 void
removeListener(ListChangeListener<? super E> listener)

Implements javafx.collections.ObservableList.removeListener.

Tries to remove a listener from this observable list.

public boolean
retainAll(E... elements)

Implements javafx.collections.ObservableList.retainAll.

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

public boolean
setAll(E... elements)

Implements javafx.collections.ObservableList.setAll.

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

public boolean
setAll(Collection<? extends E> 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Annotations
@Override