JavaFX on JDK 8 has a shorter support timeline than JDK 8. Update releases of JDK 8 after March 2028 will not include JavaFX. Visit www.oracle.com/javase/javafx for details.
public final class FilteredList<E> extends TransformationList<E,E>
TransformationList| Type | Property and Description |
|---|---|
ObjectProperty<java.util.function.Predicate<? super E>> |
predicate
The predicate that will match the elements that will be in this FilteredList.
|
| 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 |
|---|---|
E |
get(int index)
Returns the element at the specified position in this list.
|
java.util.function.Predicate<? super E> |
getPredicate()
Gets the value of the property predicate.
|
int |
getSourceIndex(int index)
Maps the index of this list's element to an index in the direct source list.
|
ObjectProperty<java.util.function.Predicate<? super E>> |
predicateProperty()
The predicate that will match the elements that will be in this FilteredList.
|
void |
setPredicate(java.util.function.Predicate<? super E> predicate)
Sets the value of the property 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.
|
getSource, getSourceIndexFor, isInTransformationChainaddAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll, setAlladd, 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, waitaddAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sortedadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArrayaddListener, removeListenerpublic final ObjectProperty<java.util.function.Predicate<? super E>> predicateProperty
getPredicate(),
setPredicate(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()
getPredicate(),
setPredicate(Predicate)public final java.util.function.Predicate<? super E> getPredicate()
public final void setPredicate(java.util.function.Predicate<? super E> predicate)
protected void sourceChanged(ListChangeListener.Change<? extends E> c)
TransformationListsourceChanged in class TransformationList<E,E>c - the changepublic int size()
public E get(int index)
public int getSourceIndex(int index)
TransformationListgetSourceIndex in class TransformationList<E,E>index - the index in this listTransformationList.getSource()Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.