Package com.hk.lua
Enum LuaLibraryIO
- All Implemented Interfaces:
BiConsumer<Environment,LuaObject>
,Lua.LuaMethod
,Serializable
,Comparable<LuaLibraryIO>
,java.lang.constant.Constable
public enum LuaLibraryIO extends Enum<LuaLibraryIO> implements BiConsumer<Environment,LuaObject>, Lua.LuaMethod
This class is to replicate the io library from Lua.
- Author:
- theKayani
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LuaLibraryIO.LuaIOUserdata
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description static String
EXKEY_CWD
ConstantEXKEY_CWD="io.cwd"
static String
EXKEY_STDERR
ConstantEXKEY_STDERR="io.stderr"
static String
EXKEY_STDIN
ConstantEXKEY_STDIN="io.stdin"
static String
EXKEY_STDOUT
ConstantEXKEY_STDOUT="io.stdout"
static int
READMODE_A
static int
READMODE_L
static int
READMODE_LOW_L
static int
READMODE_N
static int
SEEKMODE_CUR
static int
SEEKMODE_END
static int
SEEKMODE_SET
static int
SETVBUFMODE_FULL
static int
SETVBUFMODE_LINE
static int
SETVBUFMODE_NO
-
Method Summary
Modifier and Type Method Description void
accept(Environment env, LuaObject table)
accept.LuaObject
call(LuaInterpreter interp, LuaObject[] args)
Run a Java method, or function, wrapped as a LuaObjectstatic LuaLibraryIO
valueOf(String name)
Returns the enum constant of this type with the specified name.static LuaLibraryIO[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Field Details
-
EXKEY_STDIN
ConstantEXKEY_STDIN="io.stdin"
- See Also:
- Constant Field Values
-
EXKEY_STDOUT
ConstantEXKEY_STDOUT="io.stdout"
- See Also:
- Constant Field Values
-
EXKEY_STDERR
ConstantEXKEY_STDERR="io.stderr"
- See Also:
- Constant Field Values
-
EXKEY_CWD
ConstantEXKEY_CWD="io.cwd"
- See Also:
- Constant Field Values
-
READMODE_N
public static final int READMODE_N- See Also:
- Constant Field Values
-
READMODE_A
public static final int READMODE_A- See Also:
- Constant Field Values
-
READMODE_L
public static final int READMODE_L- See Also:
- Constant Field Values
-
READMODE_LOW_L
public static final int READMODE_LOW_L- See Also:
- Constant Field Values
-
SETVBUFMODE_NO
public static final int SETVBUFMODE_NO- See Also:
- Constant Field Values
-
SETVBUFMODE_FULL
public static final int SETVBUFMODE_FULL- See Also:
- Constant Field Values
-
SETVBUFMODE_LINE
public static final int SETVBUFMODE_LINE- See Also:
- Constant Field Values
-
SEEKMODE_SET
public static final int SEEKMODE_SET- See Also:
- Constant Field Values
-
SEEKMODE_CUR
public static final int SEEKMODE_CUR- See Also:
- Constant Field Values
-
SEEKMODE_END
public static final int SEEKMODE_END- See Also:
- Constant Field Values
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
call
Description copied from interface:Lua.LuaMethod
Run a Java method, or function, wrapped as a LuaObject
- Specified by:
call
in interfaceLua.LuaMethod
- Parameters:
interp
- the interpreter executing this codeargs
- the arguments passed during execution- Returns:
- the result of the execution, if is null, will be converted into Lua nil.
-
accept
accept.
- Specified by:
accept
in interfaceBiConsumer<Environment,LuaObject>
- Parameters:
env
- a X objecttable
- a Y object
-