Lua SPOT
v1.0

se.krka.kahlua.stdlib
Class OsLib

java.lang.Object
  extended by se.krka.kahlua.stdlib.OsLib
All Implemented Interfaces:
JavaFunction

public class OsLib
extends java.lang.Object
implements JavaFunction


Field Summary
static int TIME_DIVIDEND
           
 
Method Summary
 int call(LuaCallFrame cf, int nargs)
          General contract

Input:
callFrame = the frame that contains all the arguments, and where all the results should be put.
nArgs = number of function arguments
callFrame.get(i) = an argument (0 <= i < nArgs)
static java.lang.String formatTime(java.lang.String format, java.util.Calendar cal)
           
static java.lang.Object getdate(java.lang.String format)
           
static java.lang.Object getdate(java.lang.String format, long time)
           
static java.util.Date getDateFromTable(LuaTable time)
          converts the relevant fields in the given luatable to a Date object.
static int getDayOfYear(java.util.Calendar c)
           
static LuaTable getTableFromDate(java.util.Calendar c)
           
static int getWeekOfYear(java.util.Calendar c, boolean weekStartsSunday, boolean jan1midweek)
           
static void register(LuaState state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_DIVIDEND

public static final int TIME_DIVIDEND
See Also:
Constant Field Values
Method Detail

register

public static void register(LuaState state)

call

public int call(LuaCallFrame cf,
                int nargs)
Description copied from interface: JavaFunction
General contract

Input:
callFrame = the frame that contains all the arguments, and where all the results should be put.
nArgs = number of function arguments
callFrame.get(i) = an argument (0 <= i < nArgs)

Specified by:
call in interface JavaFunction
Parameters:
cf - - the current callframe for the function
nargs - - number of function arguments
Returns:
N - number of return values. The N top objects on the stack are considered the return values

getdate

public static java.lang.Object getdate(java.lang.String format)

getdate

public static java.lang.Object getdate(java.lang.String format,
                                       long time)

formatTime

public static java.lang.String formatTime(java.lang.String format,
                                          java.util.Calendar cal)

getTableFromDate

public static LuaTable getTableFromDate(java.util.Calendar c)

getDateFromTable

public static java.util.Date getDateFromTable(LuaTable time)
converts the relevant fields in the given luatable to a Date object.

Parameters:
time - LuaTable with entries for year month and day, and optionally hour/min/sec
Returns:
a date object representing the date frim the luatable.

getDayOfYear

public static int getDayOfYear(java.util.Calendar c)

getWeekOfYear

public static int getWeekOfYear(java.util.Calendar c,
                                boolean weekStartsSunday,
                                boolean jan1midweek)

Lua SPOT
v1.0