public interface MetatableAccessor extends MetatableProvider
In Lua, only tables and (full) userdata carry their own metatables; for all other types of values T, all values of type T share a metatable. This interface provides a uniform setter for metatables of all types.
Modifier and Type | Method and Description |
---|---|
Table |
setBooleanMetatable(Table table)
Sets the metatable for the
boolean type. |
Table |
setFunctionMetatable(Table table)
Sets the metatable for the
function type. |
Table |
setLightUserdataMetatable(Table table)
Sets the metatable for light userdata.
|
Table |
setMetatable(Object instance,
Table table)
Sets the metatable of the object
instance to table . |
Table |
setNilMetatable(Table table)
Sets the metatable for nil (i.e., the
nil type) to table . |
Table |
setNumberMetatable(Table table)
Sets the metatable for the
number type. |
Table |
setStringMetatable(Table table)
Sets the metatable for the
string type. |
Table |
setThreadMetatable(Table table)
Sets the metatable for the
thread type. |
getBooleanMetatable, getFunctionMetatable, getLightUserdataMetatable, getMetatable, getNilMetatable, getNumberMetatable, getStringMetatable, getThreadMetatable
Table setNilMetatable(Table table)
nil
type) to table
.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the nil
type, may be null
nil
typeTable setBooleanMetatable(Table table)
boolean
type.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the boolean
type, may be null
boolean
typeTable setNumberMetatable(Table table)
number
type.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the number
type, may be null
number
typeTable setStringMetatable(Table table)
string
type.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the string
type, may be null
string
typeTable setFunctionMetatable(Table table)
function
type.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the function
type, may be null
function
typeTable setThreadMetatable(Table table)
thread
type.
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for the thread
type, may be null
thread
typeTable setLightUserdataMetatable(Table table)
table
may be null
: in that case, clears the metatable. Returns
the previous metatable.table
- new metatable for light userdata, may be null
Table setMetatable(Object instance, Table table)
instance
to table
.
table
may be null
: in that case, clears instance
's metatable.
Returns the previous metatable.
Note that instance
may share the metatable with other instances of the same
(Lua) type. This method provides a uniform interface for setting the metatables
of all types.
instance
- object to set the metatable of, may be null
table
- new metatable of instance
, may be null
instance
Copyright © 2016. All rights reserved.