GeezerVison is showing docs.oracle.com — ModifiableObservableListBase (Java SE 9 & JDK 9 )
Class ModifiableObservableListBase<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
| Modifier and Type |
Method |
Description |
void |
add(int index,
E element) |
Inserts the specified element at the specified position in this list
(optional operation).
|
boolean |
addAll(int index,
Collection<? extends E> c) |
Inserts all of the elements in the specified collection into this
list at the specified position (optional operation).
|
boolean |
addAll(Collection<? extends E> c) |
Adds all of the elements in the specified collection to this collection
(optional operation).
|
protected abstract void |
doAdd(int index,
E element) |
Adds the element to the List at the position of index.
|
protected abstract E |
doRemove(int index) |
Removes the element at position of index.
|
protected abstract E |
doSet(int index,
E element) |
Sets the element in the List at the position of index.
|
abstract E |
get(int index) |
Returns the element at the specified position in this list.
|
E |
remove(int index) |
Removes the element at the specified position in this list (optional
operation).
|
boolean |
remove(Object o) |
Removes a single instance of the specified element from this
collection, if it is present (optional operation).
|
boolean |
removeAll(Collection<?> c) |
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
|
protected void |
removeRange(int fromIndex,
int toIndex) |
Removes from this list all of the elements whose index is between
fromIndex, inclusive, and toIndex, exclusive.
|
boolean |
retainAll(Collection<?> c) |
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
E |
set(int index,
E element) |
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
boolean |
setAll(Collection<? extends E> col) |
Clears the ObservableList and adds all elements from the collection.
|
abstract int |
size() |
Returns the number of elements in this collection.
|
List<E> |
subList(int fromIndex,
int toIndex) |
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
-
Methods inherited from interface java.util.List
add, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, replaceAll, sort, spliterator, toArray, toArray
-
Methods inherited from class javafx.collections.ObservableListBase
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
-
-
Method Detail
-
addAll
public boolean addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection
(optional operation). The behavior of this operation is undefined if
the specified collection is modified while the operation is in progress.
(This implies that the behavior of this call is undefined if the
specified collection is this collection, and this collection is
nonempty.)
- Specified by:
addAll in interface Collection<E>
- Specified by:
addAll in interface List<E>
- Overrides:
addAll in class AbstractCollection<E>
- Parameters:
c - collection containing elements to be added to this collection
- Returns:
true if this collection changed as a result of the call
- See Also:
AbstractCollection.add(Object)
-
addAll
public boolean addAll(int index,
Collection<? extends E> c)
Inserts all of the elements in the specified collection into this
list at the specified position (optional operation). Shifts the
element currently at that position (if any) and any subsequent
elements to the right (increases their indices). The new elements
will appear in this list in the order that they are returned by the
specified collection's iterator. The behavior of this operation is
undefined if the specified collection is modified while the
operation is in progress. (Note that this will occur if the specified
collection is this list, and it's nonempty.)
- Specified by:
addAll in interface List<E>
- Overrides:
addAll in class AbstractList<E>
- Parameters:
index - index at which to insert the first element from the
specified collection
c - collection containing elements to be added to this list
- Returns:
true if this list changed as a result of the call
-
add
public void add(int index,
E element)
Inserts the specified element at the specified position in this list
(optional operation). Shifts the element currently at that position
(if any) and any subsequent elements to the right (adds one to their
indices).
- Specified by:
add in interface List<E>
- Overrides:
add in class AbstractList<E>
- Parameters:
index - index at which the specified element is to be inserted
element - element to be inserted
-
set
public E set(int index,
E element)
Replaces the element at the specified position in this list with the
specified element (optional operation).
- Specified by:
set in interface List<E>
- Overrides:
set in class AbstractList<E>
- Parameters:
index - index of the element to replace
element - element to be stored at the specified position
- Returns:
- the element previously at the specified position
-
remove
public boolean remove(Object o)
Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element e such that
Objects.equals(o, e), if
this collection contains one or more such elements. Returns
true if this collection contained the specified element (or
equivalently, if this collection changed as a result of the call).
- Specified by:
remove in interface Collection<E>
- Specified by:
remove in interface List<E>
- Overrides:
remove in class AbstractCollection<E>
- Parameters:
o - element to be removed from this collection, if present
- Returns:
true if an element was removed as a result of this call
-
remove
public E remove(int index)
Removes the element at the specified position in this list (optional
operation). Shifts any subsequent elements to the left (subtracts one
from their indices). Returns the element that was removed from the
list.
- Specified by:
remove in interface List<E>
- Overrides:
remove in class AbstractList<E>
- Parameters:
index - the index of the element to be removed
- Returns:
- the element previously at the specified position
-
size
public abstract int size()
Returns the number of elements in this collection. If this collection
contains more than Integer.MAX_VALUE elements, returns
Integer.MAX_VALUE.
- Specified by:
size in interface Collection<E>
- Specified by:
size in interface List<E>
- Specified by:
size in class AbstractCollection<E>
- Returns:
- the number of elements in this collection
|