Package com.c8db.internal.cursor
Class AbstractC8Iterable<T>
- java.lang.Object
-
- com.c8db.internal.cursor.AbstractC8Iterable<T>
-
- All Implemented Interfaces:
C8Iterable<T>,Iterable<T>
- Direct Known Subclasses:
C8CursorImpl,C8FilterIterable,C8MappingIterable
public abstract class AbstractC8Iterable<T> extends Object implements C8Iterable<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractC8Iterable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallMatch(Predicate<? super T> predicate)Returns whether all elements of thisArangoIterablematch the provided predicate.booleananyMatch(Predicate<? super T> predicate)Returns whether any elements of thisArangoIterablematch the provided predicate.<R extends Collection<? super T>>
RcollectInto(R target)Iterates over all elements of thisArangoIterableand adds each to the given target.longcount()Returns the count of elements of thisArangoIterable.C8Iterable<T>filter(Predicate<? super T> predicate)Returns aArangoIterableconsisting of the elements of thisArangoIterablethat match the given predicate.Tfirst()Returns the first element ornullif no element exists.<R> C8Iterable<R>map(Function<? super T,? extends R> mapper)Returns aArangoIterableconsisting of the results of applying the given function to the elements of thisArangoIterable.booleannoneMatch(Predicate<? super T> predicate)Returns whether no elements of thisArangoIterablematch the provided predicate.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.c8db.C8Iterable
foreach, iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
map
public <R> C8Iterable<R> map(Function<? super T,? extends R> mapper)
Description copied from interface:C8IterableReturns aArangoIterableconsisting of the results of applying the given function to the elements of thisArangoIterable.- Specified by:
mapin interfaceC8Iterable<T>- Parameters:
mapper- a function to apply to each element- Returns:
- the new
ArangoIterable
-
filter
public C8Iterable<T> filter(Predicate<? super T> predicate)
Description copied from interface:C8IterableReturns aArangoIterableconsisting of the elements of thisArangoIterablethat match the given predicate.- Specified by:
filterin interfaceC8Iterable<T>- Parameters:
predicate- a predicate to apply to each element to determine if it should be included- Returns:
- the new
ArangoIterable
-
first
public T first()
Description copied from interface:C8IterableReturns the first element ornullif no element exists.- Specified by:
firstin interfaceC8Iterable<T>- Returns:
- first element or
null
-
count
public long count()
Description copied from interface:C8IterableReturns the count of elements of thisArangoIterable.- Specified by:
countin interfaceC8Iterable<T>- Returns:
- the count of elements
-
anyMatch
public boolean anyMatch(Predicate<? super T> predicate)
Description copied from interface:C8IterableReturns whether any elements of thisArangoIterablematch the provided predicate.- Specified by:
anyMatchin interfaceC8Iterable<T>- Parameters:
predicate- a predicate to apply to elements of thisArangoIterable- Returns:
trueif any elements of theArangoIterablematch the provided predicate, otherwisefalse
-
allMatch
public boolean allMatch(Predicate<? super T> predicate)
Description copied from interface:C8IterableReturns whether all elements of thisArangoIterablematch the provided predicate.- Specified by:
allMatchin interfaceC8Iterable<T>- Parameters:
predicate- a predicate to apply to elements of thisArangoIterable- Returns:
trueif all elements of theArangoIterablematch the provided predicate, otherwisefalse
-
noneMatch
public boolean noneMatch(Predicate<? super T> predicate)
Description copied from interface:C8IterableReturns whether no elements of thisArangoIterablematch the provided predicate.- Specified by:
noneMatchin interfaceC8Iterable<T>- Parameters:
predicate- a predicate to apply to elements of thisArangoIterable- Returns:
trueif no elements of theArangoIterablematch the provided predicate, otherwisefalse
-
collectInto
public <R extends Collection<? super T>> R collectInto(R target)
Description copied from interface:C8IterableIterates over all elements of thisArangoIterableand adds each to the given target.- Specified by:
collectIntoin interfaceC8Iterable<T>- Parameters:
target- the collection to insert into- Returns:
- the filled target
-
-