|
||||||||||
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
sequencepublic interface ContractibleSequence<E>
Provides protocol for removing elements from an ordered collection of objects, whose elements can be accessed using external keys.
Method Summary | ||
---|---|---|
|
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. |
|
ContractibleSequence<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 . |
|
E |
removeAt(int index)
Removes and answers the element at a given position in this sequence. |
|
E |
removeFirst()
Removes and answers the first element of this sequence. |
|
E |
removeLast()
Removes and answers the last element of this sequence. |
|
ContractibleSequence<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> ContractibleSequence<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
ContractibleSequence<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
ContractibleSequence<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
E removeAt(int index)
index
- the index at which to remove the element
IndexOutOfBoundsException
- if index < 0
or index >=
this
collection's sizeE removeFirst()
NoSuchElementException
- if this sequence is
emptyE removeLast()
NoSuchElementException
- if this sequence is
empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |