I - input symbol typeO - output symbol typeC - context typepublic class ContextExecutableInputSUL<I extends ContextExecutableInput<? extends O,? super C>,O,C> extends AbstractContextExecutableInputSUL<I,O,C>
SUL that executes ContextExecutableInput symbols.
The creation and disposal of contexts is delegated to an external ContextExecutableInputSUL.ContextHandler.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ContextExecutableInputSUL.ContextHandler<C>
Facility for creating and disposing of contexts on which
ContextExecutableInputs operate. |
| Constructor and Description |
|---|
ContextExecutableInputSUL(ContextExecutableInputSUL.ContextHandler<C> contextHandler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canFork()
Returns whether this SUL is capable of
forking. |
protected C |
createContext() |
protected void |
disposeContext(C context) |
SUL<I,O> |
fork()
Forks this SUL, if possible.
|
post, pre, steppublic ContextExecutableInputSUL(ContextExecutableInputSUL.ContextHandler<C> contextHandler)
protected C createContext()
createContext in class AbstractContextExecutableInputSUL<I extends ContextExecutableInput<? extends O,? super C>,O,C>protected void disposeContext(C context)
disposeContext in class AbstractContextExecutableInputSUL<I extends ContextExecutableInput<? extends O,? super C>,O,C>public boolean canFork()
SULforking.true if this SUL can be forked, false otherwiseSUL.fork()public SUL<I,O> fork()
SULSUL.pre() and
SUL.post().
If SUL.canFork() returns true, this method must return a non-null object, which should
behave exactly like this SUL (in particular, it must be forkable as well). Otherwise, a UnsupportedOperationException must be thrown.
Implementation note: if resetting a SUL changes the internal state of this object in a non-trivial way (e.g., incrementing a counter to ensure independent sessions), care must be taken that forks of this SUL manipulate the same internal state.
Copyright © 2019. All rights reserved.