public class Filters extends Object
Collections.| Constructor and Description |
|---|
Filters() |
| Modifier and Type | Method and Description |
|---|---|
static <K> Collection<K> |
filteredCollection(Collection<K> collection,
Filter<? super K> collectionFilter)
Returns a collection that contains only the elements from the given
collection that match the given filter.
|
static <E> Iterator<E> |
filteredIterator(Iterator<E> iterator,
Filter<? super E> iteratorFilter)
Returns an iterator that contains only the elements from the given
iterator that match the given filter.
|
static <E> List<E> |
filteredList(List<E> list,
Filter<? super E> listFilter)
Returns a list that contains only the elements from the given list that
match the given filter.
|
static <K,V> Map<K,V> |
filteredMap(Map<K,V> map,
Filter<Map.Entry<K,V>> mapFilter)
Returns a map that contains only the elements from the given map that
match the given filter.
|
static <E> Set<E> |
filteredSet(Set<E> set,
Filter<? super E> setFilter)
Returns a set that contains only the elements from the given set that
match the given filter.
|
static <E> Filter<E> |
reverseFilter(Filter<E> filter)
Returns a filter that reverses the given filter.
|
public static <E> List<E> filteredList(List<E> list, Filter<? super E> listFilter)
E - The type of the list elementslist - The list to filterlistFilter - The list filterpublic static <E> Set<E> filteredSet(Set<E> set, Filter<? super E> setFilter)
E - The type of the set elementsset - The set to filtersetFilter - The set filterpublic static <K,V> Map<K,V> filteredMap(Map<K,V> map, Filter<Map.Entry<K,V>> mapFilter)
K - The type of the map keysV - The type of the map valuesmap - The map to filtermapFilter - The map filterpublic static <K> Collection<K> filteredCollection(Collection<K> collection, Filter<? super K> collectionFilter)
K - The type of the collection valuescollection - The collection to filtercollectionFilter - The collection filterpublic static <E> Iterator<E> filteredIterator(Iterator<E> iterator, Filter<? super E> iteratorFilter)
E - The type of the iterator elementsiterator - The iterator to filteriteratorFilter - The iterator filterCopyright © 2026. All rights reserved.