E
- リストに含まれる要素の型public abstract class ModifiableObservableListBase<E> extends ObservableListBase<E>
ObservableList
実装のベース・クラスとして役立つ抽象クラス。変更可能なObservableList
クラスを実装するには、単に次のメソッドのセットを実装します。
通知が自動的に構築されて起動されます。
別のList
に委譲する単純なObservableList
の例は次のようになります。
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); }
ObservableListBase
modCount
コンストラクタと説明 |
---|
ModifiableObservableListBase() |
修飾子と型 | メソッドと説明 |
---|---|
void |
add(int index, E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index, Collection<? extends E> c) |
protected abstract void |
doAdd(int index, E element)
element をindex の位置にあるリストに追加します。 |
protected abstract E |
doRemove(int index)
index の位置にある要素を削除します。 |
protected abstract E |
doSet(int index, E element)
element をindex の位置にあるリストに設定します。 |
abstract E |
get(int index) |
E |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
protected void |
removeRange(int fromIndex, int toIndex) |
boolean |
retainAll(Collection<?> c) |
E |
set(int index, E element) |
boolean |
setAll(Collection<? extends E> col)
ObservableListをクリアし、コレクションからすべての要素を追加します。
|
abstract int |
size() |
List<E> |
subList(int fromIndex, int toIndex) |
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
add, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator
contains, containsAll, isEmpty, toArray, toArray, toString
filtered, sorted, sorted
add, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public boolean setAll(Collection<? extends E> col)
ObservableList
ObservableList<E>
のsetAll
setAll
、クラス: ObservableListBase<E>
col
- このobservableArrayListに追加される要素を含むコレクションpublic boolean addAll(Collection<? extends E> c)
addAll
、インタフェース: Collection<E>
addAll
、インタフェース: List<E>
addAll
、クラス: AbstractCollection<E>
public boolean addAll(int index, Collection<? extends E> c)
protected void removeRange(int fromIndex, int toIndex)
removeRange
、クラス: AbstractList<E>
public boolean removeAll(Collection<?> c)
removeAll
、インタフェース: Collection<E>
removeAll
、インタフェース: List<E>
removeAll
、クラス: AbstractCollection<E>
public boolean retainAll(Collection<?> c)
retainAll
、インタフェース: Collection<E>
retainAll
、インタフェース: List<E>
retainAll
、クラス: AbstractCollection<E>
public void add(int index, E element)
public boolean remove(Object o)
remove
、インタフェース: Collection<E>
remove
、インタフェース: List<E>
remove
、クラス: AbstractCollection<E>
public abstract int size()
size
、インタフェース: Collection<E>
size
、インタフェース: List<E>
size
、クラス: AbstractCollection<E>
protected abstract void doAdd(int index, E element)
element
をindex
の位置にあるリストに追加します。
発生する可能性がある例外の説明は、AbstractList.add(java.lang.Object)
メソッドのドキュメントを参照してください。
index
- 要素を追加する位置element
- 追加される要素ClassCastException
NullPointerException
IllegalArgumentException
IndexOutOfBoundsException
- インデックスが範囲外の場合(index < 0||index> size())protected abstract E doSet(int index, E element)
index
- 要素を設定する位置element
- 指定された位置に設定される要素ClassCastException
NullPointerException
IllegalArgumentException
IndexOutOfBoundsException
- インデックスが範囲外の場合(index < 0||index>= size())protected abstract E doRemove(int index)
index
の位置にある要素を削除します。index
- 削除される要素の索引IndexOutOfBoundsException
- インデックスが範囲外の場合(index < 0||index>= size())Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.