public interface CollectionService<E>
Modifier and Type | Interface and Description |
---|---|
static interface |
CollectionService.IterationController
The controller used during closure-based iterations.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
Adds the specified element to this collection.
|
void |
atomic(Runnable update)
Executes the specified update in an atomic manner.
|
EqualityComparator<? super E> |
comparator()
Returns the full comparator used for element equality or order.
|
void |
forEach(Consumer<? super E> consumer,
CollectionService.IterationController controller)
Traverses the elements of this collection.
|
Iterator<E> |
iterator()
Returns an iterator over this collection elements.
|
boolean |
removeIf(Predicate<? super E> filter,
CollectionService.IterationController controller)
Removes from this collection the elements matching the specified
predicate.
|
CollectionService<E>[] |
trySplit(int n)
Try to splits this collection in
n sub-collections;
if not possible may return an array of length less than
n (for example of length one if no split). |
boolean add(E element)
true
if an element was added as a result of
this call; false
otherwise.void atomic(Runnable update)
EqualityComparator<? super E> comparator()
void forEach(Consumer<? super E> consumer, CollectionService.IterationController controller)
consumer
- the consumer called upon the elements of this collection.controller
- the iteration controller.boolean removeIf(Predicate<? super E> filter, CollectionService.IterationController controller)
filter
- a predicate returning true
for elements to be removed.controller
- the iteration controller.true
if at least one element has been removed;
false
otherwise.CollectionService<E>[] trySplit(int n)
n
sub-collections;
if not possible may return an array of length less than
n
(for example of length one if no split).n
- the number of sub-collection to return.IllegalArgumentException
- if n <= 0
Copyright © 2005-2013 Javolution. All Rights Reserved.