|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
E - a restriction on the types of elements that may be included in the
collectionpublic interface ExtensibleCollection<E>
Provides protocol for adding elements to and removing elements from a variable-sized collection.
| Method Summary | ||
|---|---|---|
void |
add(E newElement)
Adds a new element to this collection. |
|
void |
addAll(Collection<? extends E> newElements)
Adds each element of the given collection to this collection. |
|
void |
addAll(E[] newElements)
|
|
void |
addAll(E newElement,
E... restOfNewElements)
|
|
void |
addAll(Iterable<? extends E> newElements)
|
|
|
collect(UnaryFunctor<? super E,? extends R> transformer)
Evaluates the given transformer for each element of this collection, with the element as the parameter, and answers a new collection containing the results of these evaluations. |
|
ExtensibleCollection<E> |
reject(UnaryCondition<? super E> discriminator)
Answers a new collection which contains only the elements in this collection which cause the given discriminator to answer false. |
|
boolean |
remove(E oldElement)
Removes the first element of this collection which is equivalent to the given element. |
|
boolean |
removeAll(Collection<? extends E> oldElements)
For each element in the given collection, removes the first element from this collection which is equivalent to this element. |
|
boolean |
removeAll(E[] oldElements)
|
|
boolean |
removeAll(E oldElement,
E... restOfNewElements)
|
|
boolean |
removeAll(Iterable<? extends E> oldElements)
|
|
boolean |
removeIf(UnaryCondition<? super E> discriminator)
Removes each element of this collection which causes the given discriminator to answer true. |
|
boolean |
retainAll(Collection<? extends E> keepers)
Removes each element of this collection that is not contained in the given collection. |
|
boolean |
retainAll(E[] keepers)
|
|
boolean |
retainAll(E keeper,
E... restOfKeepers)
|
|
boolean |
retainAll(Iterable<? extends E> keepers)
|
|
boolean |
retainIf(UnaryCondition<? super E> discriminator)
Removes each element of this collection which causes the given discriminator to answer false. |
|
ExtensibleCollection<E> |
select(UnaryCondition<? super E> discriminator)
Answers a new collection which contains only the elements in this collection which cause the given discriminator to answer true. |
|
| Methods inherited from interface jaggregate.Collection |
|---|
allSatisfy, anySatisfy, detect, forEachDo, includes, inject, isEmpty, occurrencesOf, rehash, size, toArray, toArray, toBag, toIdentityBag, toIdentitySet, toOrderedCollection, toSet, toSortedCollection, toSortedCollection |
| Method Detail |
|---|
<R> ExtensibleCollection<R> collect(UnaryFunctor<? super E,? extends R> transformer)
forEachDo for this collection.
Unless specifically refined, this message is defined to answer an object
conforming to the same protocol as this collection.
collect in interface Collection<E>R - return type of the transformertransformer - the transformer to evaluate
ExtensibleCollection<E> reject(UnaryCondition<? super E> discriminator)
false.
For each element of this collection, discriminator is evaluated with the
element as the parameter. Each element which causes discriminator to
answer false is included in the new collection.
The elements are traversed in the order specified by forEachDo for this collection.
Unless specifically refined, this message is defined to answer an object
conforming to the same protocol as this collection. If both this collection
and the result maintain an ordering of their elements, the elements of the
result will be in the same relative order as the elements of this collection.
reject in interface Collection<E>discriminator - the discriminator to evaluate
ExtensibleCollection<E> select(UnaryCondition<? super E> discriminator)
true.
For each element of this collection, discriminator is evaluated with the
element as the parameter. Each element which causes discriminator to
answer true is included in the new collection.
The elements are traversed in order specified by forEachDo for this collection.
Unless specifically refined, this message is defined to answer an object
conforming to the same protocol as this collection. If both this collection
and the result maintain an ordering of their elements, the elements of the
result will be in the same relative order as the elements of this collection.
select in interface Collection<E>discriminator - the discriminator to evaluate
void add(E newElement)
newElement in the element traversal order is unspecified.
Conformant protocols may place restrictions on the characteristics of objects
that are valid elements. Unless otherwise specified, any object that is of the
same class as or of a subclass of this collection's type parameter is acceptable.
newElement - the element to add
IllegalArgumentException - if newElement is found to violate
restrictions on the characteristics of valid elementsvoid addAll(Collection<? extends E> newElements)
newElements to this
collection using add with the element as the parameter.
The newElements are traversed in the order specified by forEachDo for newElements.
newElements - the elements to add
NullPointerException - if newElements is null
IllegalArgumentException - if any of newElements is found to
violate restrictions on the characteristics of valid elementsvoid addAll(E[] newElements)
newElements - the elements to add
NullPointerException - if newElements is null
IllegalArgumentException - if any of newElements is found to
violate restrictions on the characteristics of valid elementsaddAll(Collection)
void addAll(E newElement,
E... restOfNewElements)
newElement - first new element to addrestOfNewElements - remainder of the elements to add
NullPointerException - if restOfNewElements is null
IllegalArgumentException - if any of the new elements is found to violate
restrictions on the characteristics of valid elementsaddAll(Collection)void addAll(Iterable<? extends E> newElements)
newElements - the elements to add
NullPointerException - if newElements is null
IllegalArgumentException - if any of newElements is found to
violate restrictions on the characteristics of valid elementsaddAll(Collection)boolean remove(E oldElement)
forEachDo for this collection.
oldElement - the element to remove
true if any removal occurredboolean removeAll(Collection<? extends E> oldElements)
oldElements from this collection using remove with the
element as the parameter.
oldElements - the elements to remove
true if any removal occurred
NullPointerException - if oldElements is nullboolean removeAll(E[] oldElements)
oldElements - the elements to remove
true if any removal occurred
NullPointerException - if oldElements is nullremoveAll(Collection)
boolean removeAll(E oldElement,
E... restOfNewElements)
oldElement - first element to removerestOfNewElements - remainder of the elements to remove
true if any removal occurred
NullPointerException - if restOfOldElements is nullremoveAll(Collection)boolean removeAll(Iterable<? extends E> oldElements)
oldElements - the elements to remove
true if any removal occurred
NullPointerException - if oldElements is nullremoveAll(Collection)boolean removeIf(UnaryCondition<? super E> discriminator)
true.
The elements are tested in the same order in which they would be enumerated by
forEachDo for this collection.
discriminator - the discriminator to evaluate
true if any removal occurred
NullPointerException - if discriminator is nullboolean retainAll(Collection<? extends E> keepers)
keepers - the elements to retain
true if any removal occurred
NullPointerException - if keepers is nullboolean retainAll(E[] keepers)
keepers - the elements to retain
true if any removal occurred
NullPointerException - if keepers is nullretainAll(Collection)
boolean retainAll(E keeper,
E... restOfKeepers)
keeper - first element to retainrestOfKeepers - remainder of the elements to retain
true if any removal occurred
NullPointerException - if restOfKeepers is nullretainAll(Collection)boolean retainAll(Iterable<? extends E> keepers)
keepers - the elements to retain
true if any removal occurred
NullPointerException - if keepers is nullretainAll(Collection)boolean retainIf(UnaryCondition<? super E> discriminator)
false.
The elements are tested in the same order in which they would be enumerated by
forEachDo for this collection.
discriminator - the discriminator to evaluate
true if any removal occurred
NullPointerException - if discriminator is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||