public class UnimplementedFunction extends AbstractFunction0
UnsupportedOperationException
when invoked,
for use as a placeholder for unimplemented functions.Constructor and Description |
---|
UnimplementedFunction()
Constructs a new instance of
UnimplementedFunction without a name for error
reporting. |
UnimplementedFunction(String name)
Constructs a new instance of
UnimplementedFunction with the given name
for error reporting. |
Modifier and Type | Method and Description |
---|---|
void |
invoke(ExecutionContext context)
Invokes this function in the given execution context
context without arguments. |
void |
resume(ExecutionContext context,
Object suspendedState)
Resumes this resumable in the given execution context
context , passing
the suspended state suspendedState to it. |
public UnimplementedFunction(String name)
UnimplementedFunction
with the given name
for error reporting. name
may be null
, in which case no name will
be included in error messages.name
- function name for error reporting, may be null
public UnimplementedFunction()
UnimplementedFunction
without a name for error
reporting. Equivalent to UnimplementedFunction(null)
.public void invoke(ExecutionContext context) throws ResolvedControlThrowable
LuaFunction
context
without arguments.
The result of the invocation will be stored in the return buffer of the execution context.
This method throws a ResolvedControlThrowable
:
this method is expected to have resolved non-local control changes up to the point
of its invocation.
This method is not meant to be invoked directly by client code, since
the invocation does not handle possible tail call returns and resolves non-local
control changes.
Unless it is known that this method does not perform a tail call,
use Dispatch.call(ExecutionContext, Object)
instead.
The behaviour of this method is undefined when context
is null
.
invoke
in class LuaFunction
context
- execution context, must not be null
ResolvedControlThrowable
- if the call initiates a non-local control changepublic void resume(ExecutionContext context, Object suspendedState) throws ResolvedControlThrowable
Resumable
context
, passing
the suspended state suspendedState
to it.
This method throws a ResolvedControlThrowable
:
this method is expected to have resolved non-local control changes up to the point
of its invocation.
This method is called by the call executor when resuming a previously suspended
function call, possibly with a different execution context. suspendedState
is guaranteed by the executor to be equivalent to the suspended state registered
by the call to UnresolvedControlThrowable.resolve(Resumable, Object)
. Equivalence here
means that the class will be equal to that of the state object previously registered;
however, the actual instance passed to this method may be a clone or a (serialised
and) de-serialised version of the original object.
Implementations of this method may safely assume that context
is not
null
.
context
- execution context, non-null
when called by a call executorsuspendedState
- suspended state, equivalent to the suspended state registered
with the call executorResolvedControlThrowable
- if the resumed call initiates a non-local control changeCopyright © 2016. All rights reserved.