public final class FilteredList<E> extends TransformationList<E,E>
TransformationList
Type | Property and Description |
---|---|
<any> |
predicate
The predicate that will match the elements that will be in this FilteredList.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.function.Predicate |
ALWAYS_TRUE |
private int[] |
filtered |
private SortHelper |
helper |
private <any> |
predicate
The predicate that will match the elements that will be in this FilteredList.
|
private int |
size |
Constructor and Description |
---|
FilteredList(<any> source)
Constructs a new FilteredList wrapper around the source list.
|
FilteredList(<any> 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(<any> 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()
Gets the value of the property predicate.
|
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.
|
int |
getViewIndex(int index)
Maps the index of the direct source list's element to an index in this list.
|
private void |
permutate(<any> c) |
<any> |
predicateProperty()
The predicate that will match the elements that will be in this FilteredList.
|
private void |
refilter() |
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(<any> c)
Called when a change from the source is triggered.
|
private void |
update(<any> c) |
private void |
updateIndexes(int from,
int delta) |
getSource, getSourceIndexFor, isInTransformationChain
public final <any> predicateProperty
getPredicate()
,
setPredicate(Predicate)
private int[] filtered
private int size
private SortHelper helper
private static final java.util.function.Predicate ALWAYS_TRUE
private <any> predicate
public FilteredList(<any> 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(<any> source)
This constructor might be useful if you want to bind predicateProperty()
of this list.
source
- the source listpublic final <any> predicateProperty()
getPredicate()
,
setPredicate(Predicate)
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(<any> c)
TransformationList
sourceChanged
in class TransformationList<E,E>
c
- the changepublic int size()
public E get(int index)
index
- index of the element to returnjava.lang.IndexOutOfBoundsException
public int getSourceIndex(int index)
TransformationList
getSourceIndex
in class TransformationList<E,E>
index
- the index in this listTransformationList.getSource()
public int getViewIndex(int index)
TransformationList
getViewIndex
in class TransformationList<E,E>
index
- the index in the source listTransformationList.getSource()
,
TransformationList.getSourceIndex(int)
private SortHelper getSortHelper()
private int findPosition(int p)
private void ensureSize(int size)
private void updateIndexes(int from, int delta)
private void permutate(<any> c)
private void addRemove(<any> c)
private void update(<any> c)
private void refilter()