|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
RawType - A - public interface ProtoMonad<Type,RawType,A>
Very basic definition of a type that can act as a container or computation of other objects, with mapping, filtering and potentially asynchronous iteration capabilities
| Method Summary | ||
|---|---|---|
Type |
each(Executable<? super A> block)
Answers a ProtoMonad that executes the given block for each of its elements. |
|
Type |
filter(Evaluable<? super A> predicate)
Preserves elements that satisfy the given predicate |
|
void |
forEach(Executable<? super A> block)
Executes the given Executable for each element in this
ProtoMonad. |
|
|
map(Applicable<? super A,? extends B> function)
Transforms each element using the given function |
|
Type |
replace(A element,
A replacement)
Replaces all elements equal to the give one with the given replacement |
|
Type |
replaceNull(A replacement)
Replaces all null elements with the given replacement |
|
Type |
skip(A element)
Preserves all elements except those that are equal to the given one. |
|
Type |
skipNull()
Preserves all elements except nulls Equivalent to filter(Predicates.notNull()) |
|
| Method Detail |
|---|
<B> RawType map(Applicable<? super A,? extends B> function)
B - function - the mapper used to transform each element, applying it
ProtoMonad that contains or computes the result of
applying the given function to each elementType filter(Evaluable<? super A> predicate)
predicate
predicate -
ProtoMonad that will contain or compute only elements
that evaluate to true
void forEach(@NonNull
Executable<? super A> block)
Executable for each element in this
ProtoMonad. ProtoMonad does not guarantee that this message
is evaluated synchronously or that elements are visited in any particular
order
block -
Type skip(@NonNull
A element)
filter(Predicates.equal(element).not())
element -
ProtoMonad that contains or computes elements that are
not equal to the given oneType skipNull()
filter(Predicates.notNull())
ProtoMonad that contains or computes elements that are
not null
Type replace(@NonNull
A element,
A replacement)
replacement
element - the non null element to be replacedreplacement -
ProtoMonad that computes or contains the same elements
that this, except of those equal to the given element, that
are replaced by the given replacementType replaceNull(A replacement)
replacement
replacement -
ProtoMonad that computes or contains the same elements
that this, except of those null, which are replaced by the given
replacement
Type each(@NonNull
Executable<? super A> block)
map(Functions.impure(block)
block -
ProtoMonad that computes or contains the same elements of
this ProtoMonad, but adding to them and the environment the
effects produced by the given block
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||