public final class Dispatch extends Object
Modifier and Type | Method and Description |
---|---|
static void |
add(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a + b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
add(Number a,
Number b)
Returns the value of the Lua expression
a + b , where a and b
are numbers. |
static void |
band(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a & b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
bnot(ExecutionContext context,
Object o)
Evaluates the Lua expression
~o , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
bor(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a | b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
bxor(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a ~ b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
call(ExecutionContext context,
Object target)
Calls the object
target with no arguments. |
static void |
call(ExecutionContext context,
Object target,
Object arg1)
Calls the object
target with a single argument arg1 . |
static void |
call(ExecutionContext context,
Object target,
Object[] args)
Calls the object
target with the arguments passed in the array args . |
static void |
call(ExecutionContext context,
Object target,
Object arg1,
Object arg2)
Calls the object
target with the arguments arg1 and arg2 . |
static void |
call(ExecutionContext context,
Object target,
Object arg1,
Object arg2,
Object arg3)
Calls the object
target with the arguments arg1 , arg2 and
arg3 . |
static void |
call(ExecutionContext context,
Object target,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Calls the object
target with the arguments arg1 , arg2 ,
arg3 and arg4 . |
static void |
call(ExecutionContext context,
Object target,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
Calls the object
target with the arguments arg1 , arg2 ,
arg3 , arg4 and arg5 . |
static void |
concat(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression {@code a ..
|
static void |
div(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a / b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
div(Number a,
Number b)
Returns the value of the Lua expression
a / b , where a and b
are numbers. |
static void |
eq(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a == b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static boolean |
eq(Number a,
Number b)
Returns the value of the Lua expression
a == b , where a and b
are numbers. |
static void |
idiv(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a // b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
idiv(Number a,
Number b)
Returns the value of the Lua expression
a // b , where a and b
are numbers. |
static void |
index(ExecutionContext context,
Object table,
Object key)
Evaluates the Lua expression
table[key] (in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context . |
static void |
index(ExecutionContext context,
Table table,
long key)
Evaluates the Lua expression
table[key] (in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context . |
static void |
index(ExecutionContext context,
Table table,
Object key)
Evaluates the Lua expression
table[key] (in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context . |
static void |
le(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a <= b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static boolean |
le(Number a,
Number b)
Returns the value of the Lua expression
a <= b , where a and b
are numbers. |
static boolean |
le(String a,
String b)
Returns the value of the Lua expression
a <= b , where a and b
are strings. |
static void |
len(ExecutionContext context,
Object o)
Evaluates the Lua expression
#o , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static long |
len(String s)
Returns the value of the Lua expression
#s , where s is a string. |
static void |
lt(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a < b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static boolean |
lt(Number a,
Number b)
Returns the value of the Lua expression
a < b , where a and b
are numbers. |
static boolean |
lt(String a,
String b)
Returns the value of the Lua expression
a < b , where a and b
are strings. |
static void |
mod(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a % b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
mod(Number a,
Number b)
Returns the value of the Lua expression
a % b , where a and b
are numbers. |
static void |
mul(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a * b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
mul(Number a,
Number b)
Returns the value of the Lua expression
a * b , where a and b
are numbers. |
static void |
neq(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a != b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
pow(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a ^ b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
pow(Number a,
Number b)
Returns the value of the Lua expression
a ^ b , where a and b
are numbers. |
static void |
setindex(ExecutionContext context,
Object table,
Object key,
Object value)
Executes the Lua statement
table[key] = value , including the handling of
metamethods, and stores the result to the return buffer associated with context . |
static void |
setindex(ExecutionContext context,
Table table,
long key,
Object value)
Executes the Lua statement
table[key] = value , including the handling of
metamethods, and stores the result to the return buffer associated with context . |
static void |
setindex(ExecutionContext context,
Table table,
Object key,
Object value)
Executes the Lua statement
table[key] = value , including the handling of
metamethods, and stores the result to the return buffer associated with context . |
static void |
shl(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a << b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static void |
shr(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a >> b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static boolean |
signed_le(Number a,
Number b,
Number sign)
Returns
true iff a op b , where op is
"<= " (lesser than or equal to) if sign > 0 , or ">= " (greater
than or equal to) if sign < 0 . |
static void |
sub(ExecutionContext context,
Object a,
Object b)
Evaluates the Lua expression
a - b , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
sub(Number a,
Number b)
Returns the value of the Lua expression
a - b , where a and b
are numbers. |
static void |
unm(ExecutionContext context,
Object o)
Evaluates the Lua expression
-a , including the handling of metamethods,
and stores the result to the return buffer associated with context . |
static Number |
unm(Number n)
Returns the value of the Lua expression
-n , where n is a number. |
public static void call(ExecutionContext context, Object target) throws UnresolvedControlThrowable
target
with no arguments.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target()
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object arg1) throws UnresolvedControlThrowable
target
with a single argument arg1
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(arg1)
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
arg1
- the first argument to the call, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object arg1, Object arg2) throws UnresolvedControlThrowable
target
with the arguments arg1
and arg2
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(arg1, arg2)
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
arg1
- the first argument to the call, may be null
arg2
- the second argument to the call, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object arg1, Object arg2, Object arg3) throws UnresolvedControlThrowable
target
with the arguments arg1
, arg2
and
arg3
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(arg1, arg2, arg3)
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
arg1
- the first argument to the call, may be null
arg2
- the second argument to the call, may be null
arg3
- the third argument to the call, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object arg1, Object arg2, Object arg3, Object arg4) throws UnresolvedControlThrowable
target
with the arguments arg1
, arg2
,
arg3
and arg4
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(arg1, arg2, arg3, arg4)
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
arg1
- the first argument to the call, may be null
arg2
- the second argument to the call, may be null
arg3
- the third argument to the call, may be null
arg4
- the fourth argument to the call, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) throws UnresolvedControlThrowable
target
with the arguments arg1
, arg2
,
arg3
, arg4
and arg5
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(arg1, arg2, arg3, arg4, arg5)
including metamethod handling and tail call evaluation. Consequently, target
may be any value (i.e., is not required to be a function).
The results of the call will be stored in the return buffer associated with
context
.
context
- execution context, must not be null
target
- call target, may be null
arg1
- the first argument to the call, may be null
arg2
- the second argument to the call, may be null
arg3
- the third argument to the call, may be null
arg4
- the fourth argument to the call, may be null
arg5
- the fifth argument to the call, may be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void call(ExecutionContext context, Object target, Object[] args) throws UnresolvedControlThrowable
target
with the arguments passed in the array args
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This is the equivalent of the Lua expression
target(a_0, ..., a_n)
where a_i
denotes the value of args[i]
and n
is equal
to (args.length - 1)
, including metamethod handling and tail call evaluation.
Consequently, target
may be any value (i.e., is not required to be a function).
Following the contract of LuaFunction.invoke(ExecutionContext, Object[])
,
the array args
passed to the called function may not be modified by
the function and the reference to args
must not be retained by the function beyond
the scope of this method's invocation. It is therefore safe to assume that the contents of
args
will be the same after this method has returned. (No need for a defensive
copy.)
The results of the call will be stored in the return buffer associated with
context
.
If args
is null
, then the behaviour of this method is undefined.
context
- execution context, must not be null
target
- call target, may be null
args
- call arguments, must not be null
UnresolvedControlThrowable
- if the call initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if target
is not a function
and does not have the __call
metamethodpublic static void add(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a + b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __add
metamethodpublic static Number add(Number a, Number b)
a + b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a + b
NullPointerException
- if a
or b
is null
public static void sub(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a - b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __sub
metamethodpublic static Number sub(Number a, Number b)
a - b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a - b
NullPointerException
- if a
or b
is null
public static void mul(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a * b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __mul
metamethodpublic static Number mul(Number a, Number b)
a * b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a * b
NullPointerException
- if a
or b
is null
public static void div(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a / b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __div
metamethodpublic static Number div(Number a, Number b)
a / b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a / b
NullPointerException
- if a
or b
is null
public static void mod(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a % b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __mod
metamethodpublic static Number mod(Number a, Number b)
a % b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a % b
NullPointerException
- if a
or b
is null
public static void idiv(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a // b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __idiv
metamethodpublic static Number idiv(Number a, Number b)
a // b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a // b
NullPointerException
- if a
or b
is null
public static void pow(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a ^ b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an arithmetic value and neither a
nor
b
has the __pow
metamethodpublic static Number pow(Number a, Number b)
a ^ b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a ^ b
NullPointerException
- if a
or b
is null
public static void band(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a & b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an integer value and neither a
nor
b
has the __band
metamethodpublic static void bor(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a | b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an integer value and neither a
nor
b
has the __bor
metamethodpublic static void bxor(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a ~ b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an integer value and neither a
nor
b
has the __bxor
metamethodpublic static void shl(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a << b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an integer value and neither a
nor
b
has the __shl
metamethodpublic static void shr(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a >> b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
an integer value and neither a
nor
b
has the __shr
metamethodpublic static void unm(ExecutionContext context, Object o) throws UnresolvedControlThrowable
-a
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
o
- the argument, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if o
does not have an arithmetic value
and does not have the __unm
metamethodpublic static Number unm(Number n)
-n
, where n
is a number.
Note that when n
is a number, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
n
- the argument, must not be null
-a
NullPointerException
- if n
is null
public static void bnot(ExecutionContext context, Object o) throws UnresolvedControlThrowable
~o
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
o
- the argument, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if o
does not have an integer value
and does not have the __bnot
metamethodpublic static long len(String s)
#s
, where s
is a string.
Note that when s
is a string, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
s
- the string argument, must not be null
#s
NullPointerException
- if s
is null
public static void len(ExecutionContext context, Object o) throws UnresolvedControlThrowable
#o
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
o
- the argument, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if o
is not a string, does not have
the __len
metamethod, or is not a tablepublic static void concat(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a .. b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
or b
does not have
a string value and neither a
nor
b
has the __concat
metamethodpublic static void eq(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a == b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
public static void neq(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a != b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
public static boolean eq(Number a, Number b)
a == b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a == b
NullPointerException
- if a
of b
is null
public static void lt(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a < b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
and b
are not comparable
and neither a
nor b
has the
__lt
metamethodpublic static boolean lt(Number a, Number b)
a < b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a < b
NullPointerException
- if a
of b
is null
public static boolean lt(String a, String b)
a < b
, where a
and b
are strings.
Note that when a
and b
are strings, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a < b
NullPointerException
- if a
of b
is null
public static void le(ExecutionContext context, Object a, Object b) throws UnresolvedControlThrowable
a <= b
, including the handling of metamethods,
and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
a
- the first operand, may be any valueb
- the second operand, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if a
and b
are not comparable
and neither a
nor b
has the
__le
metamethod and neither a
nor b
has the __lt
metamethodpublic static boolean le(Number a, Number b)
a <= b
, where a
and b
are numbers.
Note that when a
and b
are numbers, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a <= b
NullPointerException
- if a
of b
is null
public static boolean le(String a, String b)
a <= b
, where a
and b
are strings.
Note that when a
and b
are strings, no metamethods will be consulted,
and that consequently, this method does not throw UnresolvedControlThrowable
.
a
- the first operand, must not be null
b
- the second operand, must not be null
a <= b
NullPointerException
- if a
of b
is null
public static void index(ExecutionContext context, Object table, Object key) throws UnresolvedControlThrowable
table[key]
(in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
table
- the target, may be any valuekey
- the key, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if table
is not a table and does
not have the __index
metamethodpublic static void index(ExecutionContext context, Table table, Object key) throws UnresolvedControlThrowable
table[key]
(in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This method differs from index(ExecutionContext, Object, Object)
in that the table
argument is required to be a non-null
reference
to a Table
.
context
- execution context, must not be null
table
- the table, must not be null
key
- the key, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
or table
is null
public static void index(ExecutionContext context, Table table, long key) throws UnresolvedControlThrowable
table[key]
(in non-assignment context) including
the handling of metamethods, and stores the result to the return buffer associated with
context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This method differs from index(ExecutionContext, Object, Object)
in that the table
argument is required to be a non-null
reference
to a Table
, and key
is an unboxed long
.
context
- execution context, must not be null
table
- the table, must not be null
key
- the integer keyUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
or table
is null
public static void setindex(ExecutionContext context, Object table, Object key, Object value) throws UnresolvedControlThrowable
table[key] = value
, including the handling of
metamethods, and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.context
- execution context, must not be null
table
- the target, may be any valuekey
- the key, may be any valuevalue
- the value, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
is null
IllegalOperationAttemptException
- if table
is not a table and does
not have the __newindex
metamethodpublic static void setindex(ExecutionContext context, Table table, Object key, Object value) throws UnresolvedControlThrowable
table[key] = value
, including the handling of
metamethods, and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This method differs from setindex(ExecutionContext, Object, Object, Object)
in that the table
argument is required to be a non-null
reference
to a Table
.
context
- execution context, must not be null
table
- the target, must not be null
key
- the key, may be any valuevalue
- the value, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
or table
is null
public static void setindex(ExecutionContext context, Table table, long key, Object value) throws UnresolvedControlThrowable
table[key] = value
, including the handling of
metamethods, and stores the result to the return buffer associated with context
.
This method throws an UnresolvedControlThrowable
: non-local control
changes are expected to be resolved by the caller of this method.
This method differs from setindex(ExecutionContext, Object, Object, Object)
in that the table
argument is required to be a non-null
reference
to a Table
, and key
is an unboxed long
.
context
- execution context, must not be null
table
- the target, must not be null
key
- the integer keyvalue
- the value, may be any valueUnresolvedControlThrowable
- if the evaluation called a metamethod and the metamethod
initiates a non-local control changeNullPointerException
- if context
or table
is null
public static boolean signed_le(Number a, Number b, Number sign)
true
iff a
op b
, where op is
"<=
" (lesser than or equal to) if sign > 0
, or ">=
" (greater
than or equal to) if sign < 0
.
When sign
is zero or NaN, returns false
.
a
- the first operand, must not be null
b
- the second operand, must not be null
sign
- the sign, must not be null
true
iff a
is below b
depending on the sign
of sign
NullPointerException
- if a
, b
or sign
is null
Copyright © 2016. All rights reserved.