public abstract class Searches extends Object
| Constructor and Description |
|---|
Searches() |
| Modifier and Type | Method and Description |
|---|---|
static <C extends Collection<E>,E> |
find(E[] array,
C collection,
Predicate<E> predicate)
Searches the array, adding every value matching the predicate to the
passed collection.
|
static <E> List<E> |
find(E[] array,
Predicate<E> predicate)
Searches the array, yielding every value matching the predicate.
|
static <C extends Collection<E>,E> |
find(E[] array,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the array, adding every value matching the predicate to the
collection yielded by the passed supplier.
|
static <C extends Collection<E>,E> |
find(Iterable<E> iterable,
C collection,
Predicate<E> predicate)
Searches the iterable, adding every value matching the predicate to the
passed collection.
|
static <E> List<E> |
find(Iterable<E> iterable,
Predicate<E> predicate)
Searches the iterable, yielding every value matching the predicate.
|
static <C extends Collection<E>,E> |
find(Iterable<E> iterable,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the iterable, adding every value matching the predicate to the
collection yielded by the passed supplier.
|
static <C extends Collection<E>,E> |
find(Iterator<E> iterator,
C collection,
Predicate<E> predicate)
Searches the iterator, consuming it, adding every value matching the
predicate to the passed collection.
|
static <E> List<E> |
find(Iterator<E> iterator,
Predicate<E> predicate)
Searches the iterator, consuming it, yielding every value matching the
predicate.
|
static <C extends Collection<E>,E> |
find(Iterator<E> iterator,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the iterator, consuming it, adding every value matching the
predicate to the collection yielded by the passed supplier.
|
static <E> E |
findFirst(E[] array,
Predicate<E> predicate)
Searches the first matching element returning it.
|
static <E> E |
findFirst(Iterable<E> iterable,
Predicate<E> predicate)
Searches the first matching element returning it.
|
static <E> E |
findFirst(Iterator<E> iterator,
Predicate<E> predicate)
Searches the first matching element returning it.
|
static <E> E |
findLast(E[] array,
Predicate<E> predicate)
Searches the last matching element returning it.
|
static <E> E |
findLast(Iterable<E> iterable,
Predicate<E> predicate)
Searches the last matching element returning it.
|
static <E> E |
findLast(Iterator<E> iterator,
Predicate<E> predicate)
Searches the last matching element returning it.
|
static <E> E |
findOne(E[] array,
Predicate<E> predicate)
Searches the only matching element returning it.
|
static <E> E |
findOne(Iterable<E> iterable,
Predicate<E> predicate)
Searches the only matching element returning it.
|
static <E> E |
findOne(Iterator<E> iterator,
Predicate<E> predicate)
Searches the only matching element returning it.
|
static <C extends Collection<E>,E> |
search(E[] array,
C collection,
Predicate<E> predicate)
Searches the array, adding every value matching the predicate to the
passed collection.
|
static <E> List<E> |
search(E[] array,
Predicate<E> predicate)
Searches the array, adding every value matching the predicate to the
passed collection.
|
static <C extends Collection<E>,E> |
search(E[] array,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the array, adding every value matching the predicate to the
collection yielded by the passed supplier.
|
static <C extends Collection<E>,E> |
search(Iterable<E> iterable,
C collection,
Predicate<E> predicate)
Searches the iterable, adding every value matching the predicate to the
passed collection.
|
static <E> List<E> |
search(Iterable<E> iterable,
Predicate<E> predicate)
Searches the iterable, yielding every value matching the predicate.
|
static <C extends Collection<E>,E> |
search(Iterable<E> iterable,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the iterable, adding every value matching the predicate to the
collection yielded by the passed supplier.
|
static <C extends Collection<E>,E> |
search(Iterator<E> iterator,
C collection,
Predicate<E> predicate)
Searches the iterator, consuming it, adding every value matching the
predicate to the passed collection.
|
static <E> List<E> |
search(Iterator<E> iterator,
Predicate<E> predicate)
Searches the iterator, consuming it, yielding every value matching the
predicate.
|
static <C extends Collection<E>,E> |
search(Iterator<E> iterator,
Supplier<C> supplier,
Predicate<E> predicate)
Searches the iterator, consuming it, adding every value matching the
predicate to the collection yielded by the passed supplier.
|
static <E> Optional<E> |
searchFirst(E[] array,
Predicate<E> predicate)
Searches the first matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchFirst(Iterable<E> iterable,
Predicate<E> predicate)
Searches the first matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchFirst(Iterator<E> iterator,
Predicate<E> predicate)
Searches the first matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchLast(E[] array,
Predicate<E> predicate)
Searches the last matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchLast(Iterable<E> iterable,
Predicate<E> predicate)
Searches the last matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchLast(Iterator<E> iterator,
Predicate<E> predicate)
Searches the last matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchOne(E[] array,
Predicate<E> predicate)
Searches the only matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchOne(Iterable<E> iterable,
Predicate<E> predicate)
Searches the only matching element returning just element if found,
nothing otherwise.
|
static <E> Optional<E> |
searchOne(Iterator<E> iterator,
Predicate<E> predicate)
Searches the only matching element returning just element if found,
nothing otherwise.
|
public static <E> List<E> search(Iterator<E> iterator, Predicate<E> predicate)
E - the element typeiterator - the iterator to be searchedpredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(Iterator<E> iterator, C collection, Predicate<E> predicate)
C - the collection typeE - the element typeiterator - the iterator to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(Iterator<E> iterator, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typeiterator - the iterator to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementpublic static <E> List<E> search(Iterable<E> iterable, Predicate<E> predicate)
E - the element typeiterable - the iterable to be searchedpredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(Iterable<E> iterable, C collection, Predicate<E> predicate)
C - the collection typeE - the element typeiterable - the iterable to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(Iterable<E> iterable, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typeiterable - the iterable to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementpublic static <E> List<E> search(E[] array, Predicate<E> predicate)
E - the element typearray - the array to be searchedpredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(E[] array, C collection, Predicate<E> predicate)
C - the collection typeE - the element typearray - the array to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementpublic static <C extends Collection<E>,E> C search(E[] array, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typearray - the array to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementpublic static <E> List<E> find(Iterator<E> iterator, Predicate<E> predicate)
E - the element typeiterator - the iterator to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(Iterator<E> iterator, C collection, Predicate<E> predicate)
C - the collection typeE - the element typeiterator - the iterator to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(Iterator<E> iterator, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typeiterator - the iterator to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> List<E> find(Iterable<E> iterable, Predicate<E> predicate)
E - the element typeiterable - the iterable to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(Iterable<E> iterable, C collection, Predicate<E> predicate)
C - the collection typeE - the element typeiterable - the iterable to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(Iterable<E> iterable, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typeiterable - the iterable to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> List<E> find(E[] array, Predicate<E> predicate)
E - the element typearray - the array to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(E[] array, C collection, Predicate<E> predicate)
C - the collection typeE - the element typearray - the array to be searchedcollection - the collection to be filled with matching elementspredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <C extends Collection<E>,E> C find(E[] array, Supplier<C> supplier, Predicate<E> predicate)
C - the collection typeE - the element typearray - the array to be searchedsupplier - the supplier of the resulting collectionpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> Optional<E> searchFirst(E[] array, Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementpublic static <E> Optional<E> searchFirst(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementpublic static <E> Optional<E> searchFirst(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementpublic static <E> E findFirst(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> E findFirst(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> E findFirst(E[] array,
Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> Optional<E> searchOne(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundpublic static <E> Optional<E> searchOne(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundpublic static <E> Optional<E> searchOne(E[] array, Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundpublic static <E> E findOne(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundIllegalArgumentException - if no element matchespublic static <E> E findOne(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundIllegalArgumentException - if no element matchespublic static <E> E findOne(E[] array,
Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementIllegalStateException - if more than one element is foundIllegalArgumentException - if no element matchespublic static <E> Optional<E> searchLast(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementpublic static <E> Optional<E> searchLast(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementpublic static <E> Optional<E> searchLast(E[] array, Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementpublic static <E> E findLast(Iterator<E> iterator, Predicate<E> predicate)
E - the element type parameteriterator - the iterator to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> E findLast(Iterable<E> iterable, Predicate<E> predicate)
E - the element type parameteriterable - the iterable to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchespublic static <E> E findLast(E[] array,
Predicate<E> predicate)
E - the element type parameterarray - the array to be searchedpredicate - the predicate to be applied to each elementIllegalArgumentException - if no element matchesCopyright © 2017. All rights reserved.