Examples of OneArgFunction


Examples of org.luaj.vm2.lib.OneArgFunction

        }
        return frame;
    }

    private LuaValue getFrameTitle() {
        return new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue arg) {
                return valueOf("getFrameTitleNotImplemented");
            }
        };
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue getAllExpandedArguments() {
        return new OneArgFunction() {
            @Override public LuaValue call(LuaValue frameId) {
                return getFrameById(frameId).getAllArguments();
            }
        };
    }
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue frameExists() {
        return new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue arg) {
                // logger.debug("frameExists(" + arg + ")");
                return TRUE;
            }
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private OneArgFunction loadPackage() {
        return new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue arg) {
                String name = arg.tojstring();

                InputStream is = loadLocally(name);
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            @Override
            public LuaValue call(LuaValue f, LuaValue env) {
                return f;
            }
        });
        globals.set("gefenv", new OneArgFunction() {
            public LuaValue call(LuaValue f) {
                return globals;
            }
        });
        globals.set("unpack", new unpack());

        // math.log10 got removed in 5.2
        LuaValue math = globals.get("math");
        math.set("log10", new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue luaValue) {
                return valueOf(Math.log10(luaValue.checkdouble()));
            }
        });

        // table.maxn got removed in 5.2
        LuaValue table = globals.get("table");
        table.set("maxn", new OneArgFunction() {
            @Override public LuaValue call(LuaValue arg) {
                // TODO: is this correct?
                return arg.checktable().len();
            }
        });
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue unstrip() {
        return new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue arg) {
                return NIL;
            }
        };
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue messagePlain() {
        return new OneArgFunction() {
            @Override
            public LuaValue call(LuaValue data) {
                return new Message(data).plain();
            }
        };
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue fileExists() {
        return new OneArgFunction() {
            /**
             * @param page
             * @return Whether the file exists. For File- and Media-namespace titles, this is
             * expensive. It will also be recorded as an image usage for File- and Media-namespace titles.
             */
 
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

            }
        };
    }

    private LuaValue getContent() {
        return new OneArgFunction() {
            /**
             * @param page
             * @return the (unparsed) content of the page, or nil if there is no page.
             * The page will be recorded as a transclusion.
             */
 
View Full Code Here

Examples of org.luaj.vm2.lib.OneArgFunction

        table.set("usersInGroup", usersInGroup());
        return table;
    }

    private LuaValue usersInGroup() {
        return new OneArgFunction() {
            @Override public LuaValue call(LuaValue group) {
                return LuaValue.valueOf(0);
            }
        };
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.