Package org.jeegen.jee6.util
Class FilteredList<T extends Filterable>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.jeegen.jee6.util.FilteredList<T>
-
- Type Parameters:
T
- This class can only comsume Filterable classes.
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public class FilteredList<T extends Filterable> extends ArrayList<T>
This class extends anArrayList
for use with theFilterable
interface. Only Objects which implements this interface and which filter returns true are added to thisList
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description FilteredList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T element, String filter, Locale locale)
This method tries to add anFilterable
object into thisList
if the objectsFilterable.filter(String, Locale)
method returns true.void
addAll(Collection<T> collection, String filter, Locale locale)
This method tries to add all CollectionFilterable
objects into thisList
if the objectsFilterable.filter(String, Locale)
method returns true.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
add
public void add(T element, String filter, Locale locale)
This method tries to add anFilterable
object into thisList
if the objectsFilterable.filter(String, Locale)
method returns true.- Parameters:
element
- The element to add.filter
- The filter pattern to use.locale
- TheLocale
to use.
-
addAll
public void addAll(Collection<T> collection, String filter, Locale locale)
This method tries to add all CollectionFilterable
objects into thisList
if the objectsFilterable.filter(String, Locale)
method returns true.- Parameters:
collection
- TheCollection
ofFilterable
objects to add.filter
- The filter pattern to use.locale
- TheLocale
to use.
-
-