java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
javafx.collections.ObservableListBase<E>
javafx.collections.ModifiableObservableListBase<E>
- Type Parameters:
- E- the type of the elements contained in the List
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- List<E>,- Observable,- ObservableList<E>
public abstract class ModifiableObservableListBase<E> extends ObservableListBase<E>
Abstract class that serves as a base class for 
ObservableList implementations that are modifiable.
 To implement a modifiable ObservableList class, you just need to implement the following set of methods:
 
 and the notifications and built and fired automatically for you.
 Example of a simple ObservableList delegating to another List would look like this:
 
   public class ArrayObservableList<E> extends ModifiableObservableList<E> {
   private final List<E> delegate = new ArrayList<>();
   public E get(int index) {
       return delegate.get(index);
   }
   public int size() {
       return delegate.size();
   }
   protected void doAdd(int index, E element) {
       delegate.add(index, element);
   }
   protected E doSet(int index, E element) {
       return delegate.set(index, element);
   }
   protected E doRemove(int index) {
       return delegate.remove(index);
   }
 - Since:
- JavaFX 8.0
- See Also:
- ObservableListBase
- 
Field SummaryFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructors Constructor Description ModifiableObservableListBase()Creates a defaultModifiableObservableListBase.
- 
Method SummaryModifier and Type Method Description voidadd(int index, E element)booleanaddAll(int index, Collection<? extends E> c)booleanaddAll(Collection<? extends E> c)protected abstract voiddoAdd(int index, E element)Adds theelementto the List at the position ofindex.protected abstract EdoRemove(int index)Removes the element at position ofindex.protected abstract EdoSet(int index, E element)Sets theelementin the List at the position ofindex.abstract Eget(int index)Eremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)protected voidremoveRange(int fromIndex, int toIndex)booleanretainAll(Collection<?> c)Eset(int index, E element)booleansetAll(Collection<? extends E> col)Clears the ObservableList and adds all elements from the collection.abstract intsize()List<E>subList(int fromIndex, int toIndex)Methods inherited from class javafx.collections.ObservableListBaseaddAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAllMethods inherited from class java.util.AbstractListadd, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIteratorMethods inherited from class java.util.AbstractCollectioncontains, containsAll, isEmpty, toArray, toArray, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Listadd, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, toArray, toArrayMethods inherited from interface javafx.collections.ObservableListfiltered, sorted, sorted
- 
Constructor Details- 
ModifiableObservableListBasepublic ModifiableObservableListBase()Creates a defaultModifiableObservableListBase.
 
- 
- 
Method Details- 
setAllDescription copied from interface:ObservableListClears the ObservableList and adds all elements from the collection.- Specified by:
- setAllin interface- ObservableList<E>
- Overrides:
- setAllin class- ObservableListBase<E>
- Parameters:
- col- the collection with elements that will be added to this observableArrayList
- Returns:
- true (as specified by Collection.add(E))
 
- 
addAll- Specified by:
- addAllin interface- Collection<E>
- Specified by:
- addAllin interface- List<E>
- Overrides:
- addAllin class- AbstractCollection<E>
 
- 
addAll
- 
removeRangeprotected void removeRange(int fromIndex, int toIndex)- Overrides:
- removeRangein class- AbstractList<E>
 
- 
removeAll- Specified by:
- removeAllin interface- Collection<E>
- Specified by:
- removeAllin interface- List<E>
- Overrides:
- removeAllin class- AbstractCollection<E>
 
- 
retainAll- Specified by:
- retainAllin interface- Collection<E>
- Specified by:
- retainAllin interface- List<E>
- Overrides:
- retainAllin class- AbstractCollection<E>
 
- 
add
- 
set
- 
remove- Specified by:
- removein interface- Collection<E>
- Specified by:
- removein interface- List<E>
- Overrides:
- removein class- AbstractCollection<E>
 
- 
remove
- 
subList
- 
get
- 
sizepublic abstract int size()- Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein interface- List<E>
- Specified by:
- sizein class- AbstractCollection<E>
 
- 
doAddAdds theelementto the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of AbstractList.add(java.lang.Object)method.- Parameters:
- index- the position where to add the element
- element- the element that will be added
- Throws:
- ClassCastException- if the type of the specified element is incompatible with this list
- NullPointerException- if the specified arguments contain one or more null elements
- IllegalArgumentException- if some property of this element prevents it from being added to this list
- IndexOutOfBoundsException- if the index is out of range- (index < 0 || index > size())
 
- 
doSetSets theelementin the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of set(int, java.lang.Object)method.- Parameters:
- index- the position where to set the element
- element- the element that will be set at the specified position
- Returns:
- the old element at the specified position
- Throws:
- ClassCastException- if the type of the specified element is incompatible with this list
- NullPointerException- if the specified arguments contain one or more null elements
- IllegalArgumentException- if some property of this element prevents it from being added to this list
- IndexOutOfBoundsException- if the index is out of range- (index < 0 || index >= size())
 
- 
doRemoveRemoves the element at position ofindex.- Parameters:
- index- the index of the removed element
- Returns:
- the removed element
- Throws:
- IndexOutOfBoundsException- if the index is out of range- (index < 0 || index >= size())
 
 
-