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 booleanforEachWhile(Predicate<? super E> predicate)Checks the givenpredicateon each element in this collection until all elements have been processed or the predicate returns false for some element, or throws an Exception.longsizeAsLong()
-
-
-
Method Detail
-
forEachWhile
boolean forEachWhile(Predicate<? super E> predicate)
Checks the givenpredicateon 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
trueimmediately.- Parameters:
predicate- the predicate to be checked for each element- Returns:
trueif there are no elements in the collection, or if the predicate returnedtruefor all elements of the collection,falseif the predicate returnedfalsefor 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()
-
-