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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
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. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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) | 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. |
Creation details
Section titled “Creation details”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.
replay
Section titled “replay”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.
Method details
Section titled “Method details”Object run(SignalReplaySlice slice)
Runs slice and returns its value.
define
Section titled “define”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.
position
Section titled “position”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.
getDefinitionList
Section titled “getDefinitionList”List<Signal<?>> getDefinitionList()
Returns the reads made by the definitions of local variables, in the order of the code.
getSelf
Section titled “getSelf”Object getSelf()
Returns the object that the bytecode calls this.
isDefinitions
Section titled “isDefinitions”boolean isDefinitions()
If true, the run computes the definitions of local variables again.
getHoleMap
Section titled “getHoleMap”Map<String,String> getHoleMap()
Returns the texts deduced for the local variables.
getPositionalMap
Section titled “getPositionalMap”Map<Object,Signal<?>> getPositionalMap()
Returns the signals matched by position.
getDirectList
Section titled “getDirectList”List<Signal<?>> getDirectList()
Returns the reads made by the slice itself.
getDefinitionCache
Section titled “getDefinitionCache”Map<SignalReplaySlice,Object[]> getDefinitionCache()
Returns the values of the definitions already run.
isPositionalNeeded
Section titled “isPositionalNeeded”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
