Package se.krka.kahlua.vm
Class KahluaUtil
java.lang.Object
se.krka.kahlua.vm.KahluaUtil
public class KahluaUtil
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description KahluaUtil()
-
Method Summary
Modifier and Type Method Description static void
assertArgNotNull(java.lang.Object o, int n, java.lang.String type, java.lang.String function)
static boolean
boolEval(java.lang.Object o)
static void
fail(java.lang.String msg)
static double
fromDouble(java.lang.Object o)
static java.lang.Object
getArg(LuaCallFrame callFrame, int n, java.lang.String function)
static KahluaTable
getClassMetatables(Platform platform, KahluaTable env)
static double
getDoubleArg(LuaCallFrame callFrame, int i, java.lang.String name)
static java.lang.Double
getNumberArg(LuaCallFrame callFrame, int n, java.lang.String function)
static java.lang.Object
getOptionalArg(LuaCallFrame callFrame, int n)
static java.lang.Double
getOptionalNumberArg(LuaCallFrame callFrame, int n)
static java.lang.String
getOptionalStringArg(LuaCallFrame callFrame, int n)
static KahluaTable
getOrCreateTable(Platform platform, KahluaTable env, java.lang.String name)
static java.lang.String
getStringArg(LuaCallFrame callFrame, int n, java.lang.String function)
static KahluaThread
getWorkerThread(Platform platform, KahluaTable env)
static long
ipow(long base, int exponent)
static boolean
isNegative(double vDouble)
static int
len(KahluaTable kahluaTable, int low, int high)
static LuaClosure
loadByteCodeFromResource(java.lang.String name, KahluaTable environment)
static void
luaAssert(boolean b, java.lang.String msg)
static java.lang.String
numberToString(java.lang.Double num)
static java.lang.Double
rawTonumber(java.lang.Object o)
static java.lang.String
rawTostring(java.lang.Object o)
static java.lang.String
rawTostring2(java.lang.Object o)
static double
round(double x)
static void
setupLibrary(KahluaTable env, KahluaThread workerThread, java.lang.String library)
static void
setWorkerThread(KahluaTable env, KahluaThread thread)
static java.lang.Boolean
toBoolean(boolean b)
static java.lang.Double
toDouble(double d)
static java.lang.Double
toDouble(long d)
static java.lang.Double
tonumber(java.lang.String s)
static java.lang.Double
tonumber(java.lang.String s, int radix)
static java.lang.String
tostring(java.lang.Object o, KahluaThread thread)
static java.lang.String
type(java.lang.Object o)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
KahluaUtil
public KahluaUtil()
-
-
Method Details
-
fromDouble
public static double fromDouble(java.lang.Object o) -
toDouble
public static java.lang.Double toDouble(double d) -
toDouble
public static java.lang.Double toDouble(long d) -
toBoolean
public static java.lang.Boolean toBoolean(boolean b) -
boolEval
public static boolean boolEval(java.lang.Object o) -
loadByteCodeFromResource
-
luaAssert
public static void luaAssert(boolean b, java.lang.String msg) -
fail
public static void fail(java.lang.String msg) -
round
public static double round(double x) -
ipow
public static long ipow(long base, int exponent) -
isNegative
public static boolean isNegative(double vDouble) -
getClassMetatables
-
getWorkerThread
-
setWorkerThread
-
getOrCreateTable
public static KahluaTable getOrCreateTable(Platform platform, KahluaTable env, java.lang.String name) -
setupLibrary
public static void setupLibrary(KahluaTable env, KahluaThread workerThread, java.lang.String library) -
numberToString
public static java.lang.String numberToString(java.lang.Double num) -
type
public static java.lang.String type(java.lang.Object o) -
tostring
-
tonumber
public static java.lang.Double tonumber(java.lang.String s) -
tonumber
public static java.lang.Double tonumber(java.lang.String s, int radix) -
rawTostring
public static java.lang.String rawTostring(java.lang.Object o) -
rawTostring2
public static java.lang.String rawTostring2(java.lang.Object o) -
rawTonumber
public static java.lang.Double rawTonumber(java.lang.Object o) -
getStringArg
public static java.lang.String getStringArg(LuaCallFrame callFrame, int n, java.lang.String function) -
getOptionalStringArg
-
getNumberArg
public static java.lang.Double getNumberArg(LuaCallFrame callFrame, int n, java.lang.String function) -
getOptionalNumberArg
-
assertArgNotNull
public static void assertArgNotNull(java.lang.Object o, int n, java.lang.String type, java.lang.String function) -
getOptionalArg
-
getArg
-
len
-
getDoubleArg
-