Skip to content

SignalReplayRun

final class SignalReplayRun
Package: dev.joid.internal.signal.replay · Module: core · Source: SignalReplayRun.java

One execution of a slice of bytecode, during the match or during a replay, with the signals it reads.

ReturnsSignatureSummary
SignalReplayRunmatch(Object self, boolean definitions, List<Signal<?>> positionalList) factoryReturns a run that matches a slice against the recorded reads; positionalList gives the signals to use by position, or null.
SignalReplayRunreplay(Object self, boolean definitions, Map<String,String> holeMap, Map<Object,Signal<?>> positionalMap) factoryReturns a run that computes a matched slice again, with the deduced texts and the signals matched by position.

ReturnsSignatureSummary
Objectrun(SignalReplaySlice slice)Runs slice and returns its value.
Object[]define(SignalReplaySlice slice, int depth)Runs the definition of a local variable once and returns its value and whether it depends on a signal, or null when it cannot run.
Signal<?>position(Object key, Class<?> owner)Returns the signal matched by position for key; throws a SignalReplayException when the reads do not fit.
List<Signal<?>>getDefinitionList()Returns the reads made by the definitions of local variables, in the order of the code.
ObjectgetSelf()Returns the object that the bytecode calls this.
booleanisDefinitions()If true, the run computes the definitions of local variables again.
Map<String,String>getHoleMap()Returns the texts deduced for the local variables.
Map<Object,Signal<?>>getPositionalMap()Returns the signals matched by position.
List<Signal<?>>getDirectList()Returns the reads made by the slice itself.
Map<SignalReplaySlice,Object[]>getDefinitionCache()Returns the values of the definitions already run.
booleanisPositionalNeeded()If true, the match needs the signals by position, since the slice reads a signal it cannot find by itself.

SignalReplayRun match(Object self, boolean definitions, List<Signal<?>> positionalList) factory

Returns a run that matches a slice against the recorded reads; positionalList gives the signals to use by position, or null.

SignalReplayRun replay(Object self, boolean definitions, Map<String,String> holeMap, Map<Object,Signal<?>> positionalMap) factory

Returns a run that computes a matched slice again, with the deduced texts and the signals matched by position.

Object run(SignalReplaySlice slice)

Runs slice and returns its value.

Object[] define(SignalReplaySlice slice, int depth)

Runs the definition of a local variable once and returns its value and whether it depends on a signal, or null when it cannot run.

Signal<?> position(Object key, Class<?> owner)

Throws:

  • SignalReplayException: …

Returns the signal matched by position for key; throws a SignalReplayException when the reads do not fit.

List<Signal<?>> getDefinitionList()

Returns the reads made by the definitions of local variables, in the order of the code.

Object getSelf()

Returns the object that the bytecode calls this.

boolean isDefinitions()

If true, the run computes the definitions of local variables again.

Map<String,String> getHoleMap()

Returns the texts deduced for the local variables.

Map<Object,Signal<?>> getPositionalMap()

Returns the signals matched by position.

List<Signal<?>> getDirectList()

Returns the reads made by the slice itself.

Map<SignalReplaySlice,Object[]> getDefinitionCache()

Returns the values of the definitions already run.

boolean isPositionalNeeded()

If true, the match needs the signals by position, since the slice reads a signal it cannot find by itself.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page