public final class FilteredList<E> extends TransformationList<E,E>
TransformationList
Type | Property and Description |
---|---|
ObjectProperty<Predicate<? super E>> |
predicate
The predicate that will match the elements that will be in this FilteredList.
|
modCount
Constructor and Description |
---|
FilteredList(ObservableList<E> source)
Constructs a new FilteredList wrapper around the source list.
|
FilteredList(ObservableList<E> source,
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.
|
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<Predicate<? super E>> |
predicateProperty()
The predicate that will match the elements that will be in this FilteredList.
|
void |
setPredicate(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, 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
parallelStream, removeIf, stream
addListener, removeListener
public final ObjectProperty<Predicate<? super E>> predicateProperty
getPredicate()
,
setPredicate(Predicate)
public FilteredList(ObservableList<E> source, 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<Predicate<? super E>> predicateProperty()
getPredicate()
,
setPredicate(Predicate)
public final Predicate<? super E> getPredicate()
public final void setPredicate(Predicate<? super E> predicate)
protected void sourceChanged(ListChangeListener.Change<? extends E> c)
TransformationList
sourceChanged
in class TransformationList<E,E>
c
- the changepublic int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractCollection<E>
public E get(int index)
get
in interface List<E>
get
in class AbstractList<E>
index
- index of the element to returnIndexOutOfBoundsException
public int getSourceIndex(int index)
TransformationList
getSourceIndex
in class TransformationList<E,E>
index
- the index in this listTransformationList.getSource()
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.