Type - the type of the contained elementspublic class QueryableList<Type> extends ArrayList<Type> implements IQueryableList<Type>
modCount| Constructor and Description |
|---|
QueryableList()
Create an empty QueryableList
|
QueryableList(Collection<Type> collection)
Create a QueryableList which contains the elements from the given collection
|
QueryableList(Iterable<Type> iterable)
Create a QueryableList which contains the elements from the given iterable
|
QueryableList(Type... items)
Create a QueryableList which contains the elements which are passed as arguments.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
any()
Check if this IQueryable contains any elements.
|
boolean |
anyMatch(java.util.function.Predicate<? super Type> predicate)
Returns whether any elements of this IQueryable match the provided predicate.
|
int |
count()
Return the number of elements in this IQueryable
|
int |
count(java.util.function.Predicate<Type> predicate)
Return number of elements in this queryable that passes the given predicate.
|
IQueryable<Type> |
distinct()
Returns an queryable consisting of the distinct elements (according to Object.equals(Object)) of this queryable.
|
QueryableList<Type> |
filter(java.util.function.Predicate<Type> predicate)
Returns an IQueryable consisting of the elements of this IQueryable that match the given predicate.
|
Optional<Type> |
findFirst()
Returns the first item in this IQueryable if exists
|
Optional<Type> |
findFirst(java.util.function.Predicate<Type> predicate)
Returns the first item in this IQueryable if exists
|
Type |
first()
Returns the first item in this IQueryable
|
Type |
first(java.util.function.Predicate<Type> predicate)
Returns the first item in this IQueryable
|
Type |
last()
Returns the last item in this IQueryable
|
<Out> QueryableList<Out> |
map(java.util.function.Function<Type,Out> mapper)
Returns a IQueryable consisting of the results of applying the given function to the elements of this IQueryable
This is an intermediate operation.
|
<Out> QueryableList<Out> |
mapMany(java.util.function.Function<Type,Iterable<Out>> mapper)
Returns a IQueryable consisting of the results of applying the given function to the elements of this IQueryable
This is an intermediate operation.
|
IQueryable<Type> |
sorted()
Returns a queryalbe consisting of the elements of this queryalbe, sorted according to natural order.
|
IQueryable<Type> |
sorted(Comparator<? super Type> comparator)
Returns a queryalbe consisting of the elements of this queryalbe, sorted according to the provided Comparator.
|
Type[] |
toArray(java.util.function.IntFunction<Type[]> generator)
Returns an array containing the elements of this IQueryable.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streampublic QueryableList()
public QueryableList(Collection<Type> collection)
collection - collection to provide the initial elements of this QueryableListpublic QueryableList(Iterable<Type> iterable)
iterable - collection to provide the initial elements of this QueryableList@SafeVarargs public QueryableList(Type... items)
items - the elements that will contained in the QueryableListpublic QueryableList<Type> filter(java.util.function.Predicate<Type> predicate)
IQueryablefilter in interface IQueryable<Type>predicate - a non-interfering, stateless predicate to apply to each element to determine if it should be includedpublic <Out> QueryableList<Out> map(java.util.function.Function<Type,Out> mapper)
IQueryablemap in interface IQueryable<Type>Out - the result of mapping the original typemapper - a non-interfering, stateless function to apply to each elementpublic <Out> QueryableList<Out> mapMany(java.util.function.Function<Type,Iterable<Out>> mapper)
IQueryablemapMany in interface IQueryable<Type>Out - the result of mapping the original typemapper - a non-interfering, stateless function to apply to each elementpublic boolean any()
IQueryableany in interface IQueryable<Type>public boolean anyMatch(java.util.function.Predicate<? super Type> predicate)
IQueryableanyMatch in interface IQueryable<Type>predicate - a non-interfering, stateless predicate to apply to elements of this queryable.public int count()
IQueryablecount in interface IQueryable<Type>public int count(java.util.function.Predicate<Type> predicate)
IQueryablecount in interface IQueryable<Type>predicate - a non-interfering, stateless predicate to apply to elements of this queryable.public Type first()
IQueryablefirst in interface IQueryable<Type>public Type first(java.util.function.Predicate<Type> predicate)
IQueryablefirst in interface IQueryable<Type>predicate - a non-interfering, stateless predicate to apply to elements of this streampublic Optional<Type> findFirst()
IQueryablefindFirst in interface IQueryable<Type>public Optional<Type> findFirst(java.util.function.Predicate<Type> predicate)
IQueryablefindFirst in interface IQueryable<Type>predicate - a non-interfering, stateless predicate to apply to elements of this streampublic Type last()
IQueryablelast in interface IQueryable<Type>public Type[] toArray(java.util.function.IntFunction<Type[]> generator)
IQueryabletoArray in interface IQueryable<Type>generator - function that generates a new array of the given type and sizepublic IQueryable<Type> sorted()
IQueryablesorted in interface IQueryable<Type>public IQueryable<Type> sorted(Comparator<? super Type> comparator)
IQueryablesorted in interface IQueryable<Type>comparator - comparator - a non-interfering, stateless Comparator to be used to compare queryalbe elementspublic IQueryable<Type> distinct()
IQueryabledistinct in interface IQueryable<Type>Copyright © 2015. All rights reserved.