public class MergeObservableList<T>
extends java.util.AbstractList<T>
ObservableList that presents multiple lists and items as one contiguous source.
Changes to any of the given lists will be reflected here. You cannot modify MergeObservableList itself other than adding and removing backing lists or items with insertItem(Object) and #insertList(ObservableList) respectively. This is a good case
where you have multiple data sources, or a handful of fixed items mixed in with lists of data.| Constructor and Description |
|---|
MergeObservableList() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnListChangedCallback(<any> listener) |
int |
backingIndexToMerge(<any> backingList,
int index)
Converts an index into a backing list into an index into this merge list.
|
T |
get(int location) |
MergeObservableList<T> |
insertItem(T object)
Inserts the given item into the merge list.
|
MergeObservableList<T> |
insertList(<any> list)
Inserts the given
ObservableList into the merge list. |
int |
mergeToBackingIndex(<any> backingList,
int index)
Converts an index into this merge list into an into an index of the given backing list.
|
void |
removeAll()
Removes all items and lists from the merge list.
|
boolean |
removeItem(T object)
Removes the given item from the merge list.
|
boolean |
removeList(<any> listToRemove)
Removes the given
ObservableList from the merge list. |
void |
removeOnListChangedCallback(<any> listener) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic void addOnListChangedCallback(<any> listener)
public void removeOnListChangedCallback(<any> listener)
public MergeObservableList<T> insertItem(T object)
public MergeObservableList<T> insertList(<any> list)
ObservableList into the merge list. Any changes in the given list
will be reflected and propagated here.public boolean removeItem(T object)
public boolean removeList(<any> listToRemove)
ObservableList from the merge list.public void removeAll()
public int mergeToBackingIndex(<any> backingList,
int index)
java.lang.IndexOutOfBoundsException - for an invalid index.java.lang.IllegalArgumentException - if the given list is not backing this merge list.public int backingIndexToMerge(<any> backingList,
int index)
java.lang.IndexOutOfBoundsException - for an invalid index.java.lang.IllegalArgumentException - if the given list is not backing this merge list.public T get(int location)