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);
}
ObservableListBasemodCount| コンストラクタと説明 |
|---|
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, setAlladd, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIteratorcontains, containsAll, isEmpty, toArray, toArray, toStringfiltered, sorted, sortedadd, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean setAll(Collection<? extends E> col)
ObservableListObservableList<E>のsetAllsetAll、クラス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 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 - 追加される要素ClassCastExceptionNullPointerExceptionIllegalArgumentExceptionIndexOutOfBoundsException - インデックスが範囲外の場合(index < 0||index> size())protected abstract E doSet(int index, E element)
elementをindexの位置にあるリストに設定します。
発生する可能性がある例外の説明は、set(int, java.lang.Object)メソッドのドキュメントを参照してください。
index - 要素を設定する位置element - 指定された位置に設定される要素ClassCastExceptionNullPointerExceptionIllegalArgumentExceptionIndexOutOfBoundsException - インデックスが範囲外の場合(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.