public final class FilteredList<E> extends TransformationList<E,E>
TransformationList
Modifier and Type | Field and Description |
---|---|
private static java.util.function.Predicate |
ALWAYS_TRUE |
private int[] |
filtered |
private SortHelper |
helper |
private ObjectProperty<java.util.function.Predicate<? super E>> |
predicate
The predicate that will match the elements that will be in this FilteredList.
|
private int |
size |
Constructor and Description |
---|
FilteredList(ObservableList<E> source)
Constructs a new FilteredList wrapper around the source list.
|
FilteredList(ObservableList<E> source,
java.util.function.Predicate<? super E> predicate)
Constructs a new FilteredList wrapper around the source list.
|
Modifier and Type | Method and Description |
---|---|
private void |
addRemove(ListChangeListener.Change<? extends E> c) |
private void |
ensureSize(int size) |
private int |
findPosition(int p) |
E |
get(int index)
Returns the element at the specified position in this list.
|
java.util.function.Predicate<? super E> |
getPredicate() |
private java.util.function.Predicate<? super E> |
getPredicateImpl() |
private SortHelper |
getSortHelper() |
int |
getSourceIndex(int index)
Maps the index of this list's element to an index in the direct source list.
|
private void |
permutate(ListChangeListener.Change<? extends E> c) |
ObjectProperty<java.util.function.Predicate<? super E>> |
predicateProperty() |
private void |
refilter() |
void |
setPredicate(java.util.function.Predicate<? super E> predicate) |
int |
size()
Returns the number of elements in this list.
|
protected void |
sourceChanged(ListChangeListener.Change<? extends E> c)
Called when a change from the source is triggered.
|
private void |
update(ListChangeListener.Change<? extends E> c) |
private void |
updateIndexes(int from,
int delta) |
getSource, getSourceIndexFor, isInTransformationChain
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll, setAll
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
addListener, removeListener
private int[] filtered
private int size
private SortHelper helper
private static final java.util.function.Predicate ALWAYS_TRUE
private ObjectProperty<java.util.function.Predicate<? super E>> predicate
public FilteredList(ObservableList<E> source, java.util.function.Predicate<? super E> predicate)
source
- the source listpredicate
- the predicate to match the elements or null to match all elements.public FilteredList(ObservableList<E> source)
This constructor might be useful if you want to bind predicateProperty()
of this list.
source
- the source listpublic final ObjectProperty<java.util.function.Predicate<? super E>> predicateProperty()
public final java.util.function.Predicate<? super E> getPredicate()
public final void setPredicate(java.util.function.Predicate<? super E> predicate)
private java.util.function.Predicate<? super E> getPredicateImpl()
protected void sourceChanged(ListChangeListener.Change<? extends E> c)
TransformationList
sourceChanged
in class TransformationList<E,E>
c
- the changepublic int size()
public E get(int index)
public int getSourceIndex(int index)
TransformationList
getSourceIndex
in class TransformationList<E,E>
index
- the index in this listTransformationList.getSource()
private SortHelper getSortHelper()
private int findPosition(int p)
private void ensureSize(int size)
private void updateIndexes(int from, int delta)
private void permutate(ListChangeListener.Change<? extends E> c)
private void addRemove(ListChangeListener.Change<? extends E> c)
private void update(ListChangeListener.Change<? extends E> c)
private void refilter()