E
- The type of elements in the stream to be evaluated.public static interface Evaluable.StreamPred<E> extends Evaluable.Pred<Stream<E>>
An interface to model a predicate for Stream
.
Evaluable.Composite<T>, Evaluable.Conjunction<T>, Evaluable.CurriedContextPred, Evaluable.Disjunction<T>, Evaluable.Func<T>, Evaluable.LeafPred<T>, Evaluable.Negation<T>, Evaluable.Pred<T>, Evaluable.StreamPred<E>, Evaluable.Transformation<T,R>
Modifier and Type | Method and Description |
---|---|
default <O> void |
accept(EvaluableIo<Stream<E>,Evaluable<Stream<E>>,O> evaluableIo,
EvaluationContext<Stream<E>> evaluationContext,
Evaluator evaluator)
Performs an evaluation of the
evaluationContext with a given evaluator . |
Evaluable<E> |
cut()
Returns an evaluable object which makes "cut" happen.
|
boolean |
defaultValue()
Returns a default value returned as the entire result of this predicate.
|
default boolean |
requestExpectationFlip()
In order to generate an informative report, the framework needs information
about the expected value for each predicate.
|
boolean |
valueToCut()
Returns a value to make a "cut" happen.
|
isSquashable, makeTrivial
default <O> void accept(EvaluableIo<Stream<E>,Evaluable<Stream<E>>,O> evaluableIo, EvaluationContext<Stream<E>> evaluationContext, Evaluator evaluator)
Evaluable
Performs an evaluation of the evaluationContext
with a given evaluator
.
boolean defaultValue()
Returns a default value returned as the entire result of this predicate.
The value
is used when a "cut" happens.
Evaluable<E> cut()
Returns an evaluable object which makes "cut" happen.
If the result of the evaluation of the returned object becomes equal to the
returned value of the valueToCut()
, a "cut" will actually happen.
boolean valueToCut()
Returns a value to make a "cut" happen.
A "cut" is a situation, where an evaluation process for the elements in the
stream is ended without reaching the last one.
This is necessary to model a functionalities of Stream
, such as
allMatch
, noneMatch
, and anyMatch
.
true
/ false
) to make a "cut" happen.default boolean requestExpectationFlip()
In order to generate an informative report, the framework needs information about the expected value for each predicate.
The "expected" value of a predicate can be different inside the tree of the Evaluables
,
when a negation is used.
If this Evaluable
node requests to flip the expectation value under the node,
this method should return true
.
true
, if the expectation flip is requested.Copyright © 2024. All rights reserved.