public class JaxxFilterableListModel<E> extends JaxxDefaultListModel<E>
| Modifier and Type | Field and Description |
|---|---|
protected org.nuiton.decorator.JXPathDecorator<E> |
decorator
the decorator of data
|
protected ArrayList<E> |
filteredItems |
protected List<Predicate<E>> |
filters |
protected String |
filterText |
delegate, valueIsAdjustinglistenerList| Constructor and Description |
|---|
JaxxFilterableListModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this list.
|
void |
addAllElements(Collection<E> elements) |
void |
addElement(E o)
Adds the specified component to the end of this list.
|
void |
addFilter(Predicate<E> filter) |
void |
clear()
Removes all of the elements from this list.
|
void |
clearFilters() |
E |
elementAt(int index)
Returns the component at the specified index.
|
void |
ensureCapacity(int minCapacity)
Increases the capacity of this list, if necessary, to ensure
that it can hold at least the number of components specified by
the minimum capacity argument.
|
org.nuiton.decorator.JXPathDecorator<E> |
getDecorator() |
E |
getElementAt(int index)
Returns the component at the specified index.
|
String |
getFilterText() |
int |
getSize()
Returns the number of components in this list.
|
void |
insertElementAt(E element,
int index)
Inserts the specified element as a component in this list at the
specified
index. |
protected void |
refilter() |
void |
refreshFilteredElements() |
E |
remove(int index)
Removes the element at the specified position in this list.
|
void |
removeAllElements()
Removes all components from this list and sets its size to zero.
|
void |
removeAllElements(Collection<E> elements) |
boolean |
removeElement(E o)
Removes the first (lowest-indexed) occurrence of the argument
from this list.
|
void |
removeElementAt(int index)
Deletes the component at the specified index.
|
void |
removeFilter(Predicate<E> filter) |
void |
removeRange(int fromIndex,
int toIndex)
Deletes the components at the specified range of indexes.
|
E |
set(int index,
E element)
Replaces the element at the specified position in this list with the
specified element.
|
void |
setAllElements(Collection<E> objects) |
void |
setDecorator(org.nuiton.decorator.JXPathDecorator<E> decorator) |
void |
setElementAt(E element,
int index)
Sets the component at the specified
index of this
list to be the specified element. |
void |
setFilterText(String filterText) |
void |
setSize(int newSize)
Sets the size of this list.
|
int |
size()
Returns the number of components in this list.
|
void |
trimToSize()
Trims the capacity of this list to be the list's current size.
|
capacity, contains, firstElement, get, indexOf, indexOf, isEmpty, isValueIsAdjusting, lastElement, lastIndexOf, lastIndexOf, refresh, refresh, setValueIsAdjusting, toArray, toList, toStringaddListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerprotected String filterText
protected org.nuiton.decorator.JXPathDecorator<E> decorator
public E getElementAt(int index)
JaxxDefaultListModelNote: Although this method is not deprecated, the preferred method to use isget(int), which implements theListinterface defined in the 1.2 Collections framework.
getElementAt in interface ListModel<E>getElementAt in class JaxxDefaultListModel<E>index - an index into this listJaxxDefaultListModel.get(int)public E elementAt(int index)
JaxxDefaultListModelArrayIndexOutOfBoundsException if the index
is negative or not less than the size of the list.
Note: Although this method is not deprecated, the preferred method to use isget(int), which implements theListinterface defined in the 1.2 Collections framework.
elementAt in class JaxxDefaultListModel<E>index - an index into this listJaxxDefaultListModel.get(int),
Vector.elementAt(int)public void addElement(E o)
JaxxDefaultListModeladdElement in class JaxxDefaultListModel<E>o - the component to be addedVector.addElement(Object)public boolean removeElement(E o)
JaxxDefaultListModelremoveElement in class JaxxDefaultListModel<E>o - the component to be removedtrue if the argument was a component of this
list; false otherwiseVector.removeElement(Object)public int getSize()
JaxxDefaultListModelsize, which implements the
List interface defined in the 1.2 Collections framework.
This method exists in conjunction with setSize so that
size is identifiable as a JavaBean property.getSize in interface ListModel<E>getSize in class JaxxDefaultListModel<E>JaxxDefaultListModel.size()public int size()
JaxxDefaultListModelsize in class JaxxDefaultListModel<E>Vector.size()public void trimToSize()
JaxxDefaultListModeltrimToSize in class JaxxDefaultListModel<E>Vector.trimToSize()public void ensureCapacity(int minCapacity)
JaxxDefaultListModelensureCapacity in class JaxxDefaultListModel<E>minCapacity - the desired minimum capacityVector.ensureCapacity(int)public void setSize(int newSize)
JaxxDefaultListModelsetSize in class JaxxDefaultListModel<E>newSize - the new size of this listVector.setSize(int)public void setElementAt(E element, int index)
JaxxDefaultListModelindex of this
list to be the specified element. The previous component at that
position is discarded.
Throws an ArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred method to use isset(int,Object), which implements theListinterface defined in the 1.2 Collections framework.
setElementAt in class JaxxDefaultListModel<E>element - what the component is to be set toindex - the specified indexJaxxDefaultListModel.set(int, Object),
Vector.setElementAt(Object, int)public void removeElementAt(int index)
JaxxDefaultListModelArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred method to use isremove(int), which implements theListinterface defined in the 1.2 Collections framework.
removeElementAt in class JaxxDefaultListModel<E>index - the index of the object to removeJaxxDefaultListModel.remove(int),
Vector.removeElementAt(int)public void insertElementAt(E element, int index)
JaxxDefaultListModelindex.
Throws an ArrayIndexOutOfBoundsException if the index
is invalid.
Note: Although this method is not deprecated, the preferred method to use isadd(int,Object), which implements theListinterface defined in the 1.2 Collections framework.
insertElementAt in class JaxxDefaultListModel<E>element - the component to insertindex - where to insert the new componentJaxxDefaultListModel.add(int, Object),
Vector.insertElementAt(Object, int)public void removeAllElements()
JaxxDefaultListModelNote: Although this method is not deprecated, the preferred method to use isclear, which implements theListinterface defined in the 1.2 Collections framework.
removeAllElements in class JaxxDefaultListModel<E>JaxxDefaultListModel.clear(),
Vector.removeAllElements()public E set(int index, E element)
JaxxDefaultListModelArrayIndexOutOfBoundsException
if the index is out of range
(index < 0 || index >= size()).set in class JaxxDefaultListModel<E>index - index of element to replaceelement - element to be stored at the specified positionpublic void add(int index,
E element)
JaxxDefaultListModelArrayIndexOutOfBoundsException if the
index is out of range
(index < 0 || index > size()).add in class JaxxDefaultListModel<E>index - index at which the specified element is to be insertedelement - element to be insertedpublic void setAllElements(Collection<E> objects)
setAllElements in class JaxxDefaultListModel<E>public void addAllElements(Collection<E> elements)
addAllElements in class JaxxDefaultListModel<E>public void removeAllElements(Collection<E> elements)
removeAllElements in class JaxxDefaultListModel<E>public E remove(int index)
JaxxDefaultListModelArrayIndexOutOfBoundsException
if the index is out of range
(index < 0 || index >= size()).remove in class JaxxDefaultListModel<E>index - the index of the element to removedpublic void clear()
JaxxDefaultListModelclear in class JaxxDefaultListModel<E>public void removeRange(int fromIndex,
int toIndex)
JaxxDefaultListModelArrayIndexOutOfBoundsException
if the index was invalid.
Throws an IllegalArgumentException if
fromIndex > toIndex.removeRange in class JaxxDefaultListModel<E>fromIndex - the index of the lower end of the rangetoIndex - the index of the upper end of the rangeJaxxDefaultListModel.remove(int)public String getFilterText()
public void setFilterText(String filterText)
public org.nuiton.decorator.JXPathDecorator<E> getDecorator()
public void setDecorator(org.nuiton.decorator.JXPathDecorator<E> decorator)
public void clearFilters()
public void refreshFilteredElements()
protected void refilter()
Copyright © 2008–2019 Ultreia.io. All rights reserved.