本文整理汇总了Java中org.luaj.vm2.Varargs.optvalue方法的典型用法代码示例。如果您正苦于以下问题:Java Varargs.optvalue方法的具体用法?Java Varargs.optvalue怎么用?Java Varargs.optvalue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.luaj.vm2.Varargs
的用法示例。
在下文中一共展示了Varargs.optvalue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addHeaderView
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue addHeaderView(U view, Varargs varargs) {
final LuaValue luaValue = varargs.optvalue(2, null);
final int width = DimenUtil.dpiToPx(varargs.arg(3));
final int height = DimenUtil.dpiToPx(varargs.arg(4));
view.addHeaderView(((UDView)luaValue).getView(), width, height);
return this;
}
示例2: addPinnedView
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue addPinnedView(U view, Varargs varargs) {
final LuaValue luaValue = varargs.optvalue(2, null);
final int width = DimenUtil.dpiToPx(varargs.arg(3));
final int height = DimenUtil.dpiToPx(varargs.arg(4));
view.addPinnedView(((UDView)luaValue).getView(), width, height);
return this;
}
示例3: addContentView
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue addContentView(U view, Varargs varargs) {
final LuaValue luaValue = varargs.optvalue(2, null);
final int width = DimenUtil.dpiToPx(varargs.arg(3));
final int height = DimenUtil.dpiToPx(varargs.arg(4));
view.addContentView(((UDView)luaValue).getView(), width, height);
return this;
}
示例4: invoke
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public Varargs invoke(Varargs args) {
LuaValue ld = args.arg1();
args.argcheck(ld.isstring() || ld.isfunction(), 1, "ld must be string or function");
String source = args.optjstring(2, ld.isstring() ? ld.tojstring() : "=(load)");
String mode = args.optjstring(3, "bt");
LuaValue env = args.optvalue(4, globals);
return loadStream(ld.isstring() ? ld.strvalue().toInputStream() : new
StringInputStream(ld.checkfunction()), source, mode, env);
}
示例5: removeView
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
/**
* 移除子类
*
* @param view
* @return
*/
public LuaValue removeView(U view, Varargs varargs) {
final LuaValue luaValue = varargs.optvalue(2, null);
if (luaValue instanceof UDView) {
return view.removeView((UDView) luaValue);
}
return view;
}
示例6: invoke
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public Varargs invoke(Varargs args) {
args.argcheck(args.isstring(1) || args.isnil(1), 1, "filename must be string or nil");
String filename = args.isstring(1)? args.tojstring(1): null;
String mode = args.optjstring(2, "bt");
LuaValue env = args.optvalue(3, globals);
return filename == null?
loadStream( globals.STDIN, "=stdin", mode, env ):
loadFile( filename, mode, env );
}
示例7: onStart
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue onStart(U udAnimator, Varargs varargs) {
final LuaValue callback = varargs.optvalue(2, NIL);
return udAnimator.setOnStartCallback(callback);
}
示例8: onResume
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue onResume(U udAnimator, Varargs varargs) {
final LuaValue callback = varargs.optvalue(2, NIL);
return udAnimator.setOnResumeCallback(callback);
}
示例9: setOnDraw
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setOnDraw(U view, Varargs varargs) {
final LuaValue callbacks = varargs.optvalue(2, NIL);
return view.setOnDrawCallback(callbacks);
}
示例10: onRepeat
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue onRepeat(U udAnimator, Varargs varargs) {
final LuaValue callback = varargs.optvalue(2, NIL);
return udAnimator.setOnRepeatCallback(callback);
}
示例11: setCallback
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setCallback(U view, Varargs varargs) {
final LuaValue callbacks = varargs.optvalue(2, NIL);
return view.setCallback(callbacks);
}
示例12: onEnd
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue onEnd(U udAnimator, Varargs varargs) {
final LuaValue callback = varargs.optvalue(2, NIL);
return udAnimator.setOnEndCallback(callback);
}
示例13: onPause
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue onPause(U udAnimator, Varargs varargs) {
final LuaValue callback = varargs.optvalue(2, NIL);
return udAnimator.setOnPauseCallback(callback);
}
示例14: setRefreshingOffset
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
@LuaViewApi(revisions = {"名称去掉set"})
public LuaValue setRefreshingOffset(U view, Varargs varargs) {
final LuaValue offset = varargs.optvalue(2, NIL);
view.setRefreshingOffset(offset.tofloat());
return this;
}
示例15: setOnShow
import org.luaj.vm2.Varargs; //导入方法依赖的package包/类
public LuaValue setOnShow(U view, Varargs varargs) {
final LuaValue callbacks = varargs.optvalue(2, NIL);
return view.setOnShowCallback(callbacks);
}