final case class Scan[T, +E](op: Stage[(T, T), T, E]) extends Endo[T, E] with Product with Serializable
An endomorphic stage that folds its own inputs into a running accumulator across pipeline runs, via the binary
operation stage op — the running-total counterpart of h8io.stages.cycles.Reduce and h8io.stages.cycles.Fold.
Unlike the h8io.stages.cycles family, Scan has no inner stage and no cycle: it consumes one external input per
outer run and threads its own accumulator from one run to the next. The first input becomes the accumulator
unchanged, without invoking op (the classic seedless reduce, seeded from the pipeline's own input stream instead
of a single seed value); each subsequent input is folded via op((accumulator, input)) and the result — the new
running total — is emitted immediately, ready for the next run.
When op is applied but itself yields no output — e.g. it filters some inputs out — the accumulator is left
unchanged rather than discarded, exactly as in Reduce/Fold, and Scan itself yields nothing for that run.
Since Scan has no separate alterand, the status of a run is simply the status op produced (or Success, for the
seeding run in which op is skipped) — there is nothing else to combine it with. Whenever that status is
h8io.stages.Status.Complete, the next generation resets to a fresh, unseeded Scan instead of continuing to
accumulate — mirroring how h8io.stages.std.Countdown resets on any non-Success status: Complete marks one
logical unit of work as finished, and the next external input starts a new one, seeding from scratch.
- T
the accumulator and input type (invariant: threaded through as both input and output of
op)- E
the error type (covariant)
- op
the binary operation stage folding the accumulator and a new input into the next accumulator
- Alphabetic
- By Inheritance
- Scan
- Serializable
- Serializable
- Product
- Equals
- Stage
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
andThen[A](g: (Yield[T, T, E]) ⇒ A): (T) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
def
apply(in: T): Yield[T, T, E]
Processes
inand returns the Yield carrying the optional output, the status and the continuation. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
def
compose[A](g: (A) ⇒ T): (A) ⇒ Yield[T, T, E]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val op: Stage[(T, T), T, E]
-
def
skip(): Evolution[T, T, E]
Returns this stage's Evolution without consuming an input.
Returns this stage's Evolution without consuming an input.
Called instead of
applywhenever the stage takes part in a run but has nothing to process: the upstream yielded no output, or a binary operator excluded this branch. The evolution must be the one the stage would have returned had it run. Likeapply,skip()may perform side effects — a decorator, for instance, may advance or release the inner stage it owns. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
~>[_O, _E >: E](that: Stage[T, _O, _E]): Stage[T, _O, _E]
Composes this stage with
that, feeding this stage's output into it.Composes this stage with
that, feeding this stage's output into it. See the Composition section above for what happens when there is no output to feed.- Definition Classes
- Stage
- Annotations
- @inline()
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated