Package io.timeandspace.collect
Interface ObjCollection<E>
-
- All Superinterfaces:
Collection<E>
,Iterable<E>
- All Known Subinterfaces:
ObjSet<E>
public interface ObjCollection<E> extends Collection<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
forEachWhile(Predicate<? super E> predicate)
Checks the givenpredicate
on each element in this collection until all elements have been processed or the predicate returns false for some element, or throws an Exception.long
sizeAsLong()
-
-
-
Method Detail
-
forEachWhile
boolean forEachWhile(Predicate<? super E> predicate)
Checks the givenpredicate
on each element in this collection until all elements have been processed or the predicate returns false for some element, or throws an Exception. Exceptions thrown by the predicate are relayed to the caller.The elements will be processed in the same order as they appear in
Collection.iterator()
andIterable.forEach(java.util.function.Consumer<? super T>)
.If the collection is empty, this method returns
true
immediately.- Parameters:
predicate
- the predicate to be checked for each element- Returns:
true
if there are no elements in the collection, or if the predicate returnedtrue
for all elements of the collection,false
if the predicate returnedfalse
for some element- Throws:
NullPointerException
- if the specified predicate is nullConcurrentModificationException
- if any structural modification of the collection (addition or removal of an element) is detected during iteration- See Also:
Iterable.forEach(java.util.function.Consumer<? super T>)
-
sizeAsLong
long sizeAsLong()
-
-