热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.luaj.vm2.LuaValue.typerror()方法的使用及代码示例

本文整理了Java中org.luaj.vm2.LuaValue.typerror()方法的一些代码示例,展示了LuaValue.typerror()的具体用法。这些代码示例主要来源于Github/St

本文整理了Java中org.luaj.vm2.LuaValue.typerror()方法的一些代码示例,展示了LuaValue.typerror()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LuaValue.typerror()方法的具体详情如下:
包路径:org.luaj.vm2.LuaValue
类名称:LuaValue
方法名:typerror

LuaValue.typerror介绍

[英]Throw a LuaError indicating an invalid type was supplied to a function
[中]抛出一个LuaError,指示向函数提供的类型无效

代码示例

代码示例来源:origin: M66B/XPrivacyLua

/**
* Convert this value to a string if it is a {@link LuaString} or {@link LuaNumber},
* or throw a {@link LuaError} if it is not
* @return {@link LuaString} corresponding to the value if a string or number
* @throws LuaError if not a string or number
*/
public LuaString strvalue() { typerror("strValue"); return null; }

代码示例来源:origin: hsllany/HtmlNative

/** Preallocate the array part of a table to be a certain size,
*


* Primarily used internally in response to a SETLIST bytecode.
* @param i the number of array slots to preallocate in the table.
* @throws LuaError if this is not a table.
*/
public void presize( int i) { typerror("table"); }

代码示例来源:origin: M66B/XPrivacyLua

/** Preallocate the array part of a table to be a certain size,
*


* Primarily used internally in response to a SETLIST bytecode.
* @param i the number of array slots to preallocate in the table.
* @throws LuaError if this is not a table.
*/
public void presize( int i) { typerror("table"); }

代码示例来源:origin: M66B/XPrivacyLua

/** Get raw length of table or string without metatag processing.
* @return the length of the table or string.
* @throws LuaError if {@code this} is not a table or string.
*/
public int rawlen() { typerror("table or string"); return 0; }

代码示例来源:origin: hsllany/HtmlNative

/** Get raw length of table or string without metatag processing.
* @return the length of the table or string.
* @throws LuaError if {@code this} is not a table or string.
*/
public int rawlen() { typerror("table or string"); return 0; }

代码示例来源:origin: hsllany/HtmlNative

/**
* Convert this value to a string if it is a {@link LuaString} or {@link LuaNumber},
* or throw a {@link LuaError} if it is not
* @return {@link LuaString} corresponding to the value if a string or number
* @throws LuaError if not a string or number
*/
public LuaString strvalue() { typerror("strValue"); return null; }

代码示例来源:origin: mirkosertic/GameComposer

/**
* Convert this value to a string if it is a {@link LuaString} or {@link LuaNumber},
* or throw a {@link LuaError} if it is not
* @return {@link LuaString} corresponding to the value if a string or number
* @throws LuaError if not a string or number
*/
public LuaString strvalue() { typerror("strValue"); return null; }

代码示例来源:origin: mirkosertic/GameComposer

/** Preallocate the array part of a table to be a certain size,
*


* Primarily used internally in response to a SETLIST bytecode.
* @param i the number of array slots to preallocate in the table.
* @throws LuaError if this is not a table.
*/
public void presize( int i) { typerror("table"); }

代码示例来源:origin: mirkosertic/GameComposer

/** Get raw length of table or string without metatag processing.
* @return the length of the table or string.
* @throws LuaError if {@code this} is not a table or string.
*/
public int rawlen() { typerror("table or string"); return 0; }

代码示例来源:origin: hsllany/HtmlNative

/** Find the next key,value pair if {@code this} is a table,
* return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over all key-value pairs in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.next(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }}

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link #NIL} to start at the beginning
* @return {@link Varargs} containing {key,value} for the next entry,
* or {@link #NIL} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #inext(LuaValue)
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs next(LuaValue index) { return typerror("table"); }

代码示例来源:origin: M66B/XPrivacyLua

/** Find the next key,value pair if {@code this} is a table,
* return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over all key-value pairs in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.next(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }}

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link #NIL} to start at the beginning
* @return {@link Varargs} containing {key,value} for the next entry,
* or {@link #NIL} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #inext(LuaValue)
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs next(LuaValue index) { return typerror("table"); }

代码示例来源:origin: mirkosertic/GameComposer

/** Find the next integer-key,value pair if {@code this} is a table,
* return {@link NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over integer keys in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.inext(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }
* }

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link NIL} to start at the beginning
* @return {@link Varargs} containing {@code (key,value)} for the next entry,
* or {@link NONE} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #next()
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs inext(LuaValue index) { return typerror("table"); }

代码示例来源:origin: hsllany/HtmlNative

/** Find the next integer-key,value pair if {@code this} is a table,
* return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over integer keys in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.inext(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }
* }

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link #NIL} to start at the beginning
* @return {@link Varargs} containing {@code (key,value)} for the next entry,
* or {@link #NONE} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #next(LuaValue)
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs inext(LuaValue index) { return typerror("table"); }

代码示例来源:origin: M66B/XPrivacyLua

/** Find the next integer-key,value pair if {@code this} is a table,
* return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over integer keys in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.inext(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }
* }

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link #NIL} to start at the beginning
* @return {@link Varargs} containing {@code (key,value)} for the next entry,
* or {@link #NONE} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #next(LuaValue)
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs inext(LuaValue index) { return typerror("table"); }

代码示例来源:origin: mirkosertic/GameComposer

/** Find the next key,value pair if {@code this} is a table,
* return {@link NIL} if there are no more, or throw a {@link LuaError} if not a table.
*


* To iterate over all key-value pairs in a table you can use
*

 {@code
* LuaValue k = LuaValue.NIL;
* while ( true ) {
* Varargs n = table.next(k);
* if ( (k = n.arg1()).isnil() )
* break;
* LuaValue v = n.arg(2)
* process( k, v )
* }}

* @param index {@link LuaInteger} value identifying a key to start from,
* or {@link NIL} to start at the beginning
* @return {@link Varargs} containing {key,value} for the next entry,
* or {@link NIL} if there are no more.
* @throws LuaError if {@code this} is not a table, or the supplied key is invalid.
* @see LuaTable
* @see #inext()
* @see #valueOf(int)
* @see Varargs#arg1()
* @see Varargs#arg(int)
* @see #isnil()
*/
public Varargs next(LuaValue index) { return typerror("table"); }

代码示例来源:origin: M66B/XPrivacyLua

/**
* Perform field assignment including metatag processing.
* @param t {@link LuaValue} on which value is being set, typically a table or something with the metatag {@link LuaValue#NEWINDEX} defined
* @param key {@link LuaValue} naming the field to assign
* @param value {@link LuaValue} the new value to assign to {@code key}
* @throws LuaError if there is a loop in metatag processing
* @return true if assignment or metatag processing succeeded, false otherwise
*/
protected static boolean settable(LuaValue t, LuaValue key, LuaValue value) {
LuaValue tm;
int loop = 0;
do {
if (t.istable()) {
if ((!t.rawget(key).isnil()) || (tm = t.metatag(NEWINDEX)).isnil()) {
t.rawset(key, value);
return true;
}
} else if ((tm = t.metatag(NEWINDEX)).isnil())
t.typerror("index");
if (tm.isfunction()) {
tm.call(t, key, value);
return true;
}
t = tm;
}
while ( ++loop error("loop in settable");
return false;
}

代码示例来源:origin: hsllany/HtmlNative

/**
* Perform field assignment including metatag processing.
* @param t {@link LuaValue} on which value is being set, typically a table or something with the metatag {@link LuaValue#NEWINDEX} defined
* @param key {@link LuaValue} naming the field to assign
* @param value {@link LuaValue} the new value to assign to {@code key}
* @throws LuaError if there is a loop in metatag processing
* @return true if assignment or metatag processing succeeded, false otherwise
*/
protected static boolean settable(LuaValue t, LuaValue key, LuaValue value) {
LuaValue tm;
int loop = 0;
do {
if (t.istable()) {
if ((!t.rawget(key).isnil()) || (tm = t.metatag(NEWINDEX)).isnil()) {
t.rawset(key, value);
return true;
}
} else if ((tm = t.metatag(NEWINDEX)).isnil())
t.typerror("index");
if (tm.isfunction()) {
tm.call(t, key, value);
return true;
}
t = tm;
}
while ( ++loop error("loop in settable");
return false;
}

代码示例来源:origin: mirkosertic/GameComposer

/**
* Perform field assignment including metatag processing.
* @param t {@link LuaValue} on which value is being set, typically a table or something with the metatag {@link LuaValue#NEWINDEX} defined
* @param key {@link LuaValue} naming the field to assign
* @param value {@link LuaValue} the new value to assign to {@code key}
* @throws LuaError if there is a loop in metatag processing
* @return true if assignment or metatag processing succeeded, false otherwise
*/
protected static boolean settable(LuaValue t, LuaValue key, LuaValue value) {
LuaValue tm;
int loop = 0;
do {
if (t.istable()) {
if ((!t.rawget(key).isnil()) || (tm = t.metatag(NEWINDEX)).isnil()) {
t.rawset(key, value);
return true;
}
} else if ((tm = t.metatag(NEWINDEX)).isnil())
t.typerror("index");
if (tm.isfunction()) {
tm.call(t, key, value);
return true;
}
t = tm;
}
while ( ++loop error("loop in settable");
return false;
}

推荐阅读
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 本文探讨了C语言中指针的应用与价值,指针在C语言中具有灵活性和可变性,通过指针可以操作系统内存和控制外部I/O端口。文章介绍了指针变量和指针的指向变量的含义和用法,以及判断变量数据类型和指向变量或成员变量的类型的方法。还讨论了指针访问数组元素和下标法数组元素的等价关系,以及指针作为函数参数可以改变主调函数变量的值的特点。此外,文章还提到了指针在动态存储分配、链表创建和相关操作中的应用,以及类成员指针与外部变量的区分方法。通过本文的阐述,读者可以更好地理解和应用C语言中的指针。 ... [详细]
  • Java中包装类的设计原因以及操作方法
    本文主要介绍了Java中设计包装类的原因以及操作方法。在Java中,除了对象类型,还有八大基本类型,为了将基本类型转换成对象,Java引入了包装类。文章通过介绍包装类的定义和实现,解答了为什么需要包装类的问题,并提供了简单易用的操作方法。通过本文的学习,读者可以更好地理解和应用Java中的包装类。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 本文整理了Java面试中常见的问题及相关概念的解析,包括HashMap中为什么重写equals还要重写hashcode、map的分类和常见情况、final关键字的用法、Synchronized和lock的区别、volatile的介绍、Syncronized锁的作用、构造函数和构造函数重载的概念、方法覆盖和方法重载的区别、反射获取和设置对象私有字段的值的方法、通过反射创建对象的方式以及内部类的详解。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • 本文介绍了使用PHP实现断点续传乱序合并文件的方法和源码。由于网络原因,文件需要分割成多个部分发送,因此无法按顺序接收。文章中提供了merge2.php的源码,通过使用shuffle函数打乱文件读取顺序,实现了乱序合并文件的功能。同时,还介绍了filesize、glob、unlink、fopen等相关函数的使用。阅读本文可以了解如何使用PHP实现断点续传乱序合并文件的具体步骤。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 从零学Java(10)之方法详解,喷打野你真的没我6!
    本文介绍了从零学Java系列中的第10篇文章,详解了Java中的方法。同时讨论了打野过程中喷打野的影响,以及金色打野刀对经济的增加和线上队友经济的影响。指出喷打野会导致线上经济的消减和影响队伍的团结。 ... [详细]
  • 本文介绍了机器学习手册中关于日期和时区操作的重要性以及其在实际应用中的作用。文章以一个故事为背景,描述了学童们面对老先生的教导时的反应,以及上官如在这个过程中的表现。同时,文章也提到了顾慎为对上官如的恨意以及他们之间的矛盾源于早年的结局。最后,文章强调了日期和时区操作在机器学习中的重要性,并指出了其在实际应用中的作用和意义。 ... [详细]
  • 浏览器中的异常检测算法及其在深度学习中的应用
    本文介绍了在浏览器中进行异常检测的算法,包括统计学方法和机器学习方法,并探讨了异常检测在深度学习中的应用。异常检测在金融领域的信用卡欺诈、企业安全领域的非法入侵、IT运维中的设备维护时间点预测等方面具有广泛的应用。通过使用TensorFlow.js进行异常检测,可以实现对单变量和多变量异常的检测。统计学方法通过估计数据的分布概率来计算数据点的异常概率,而机器学习方法则通过训练数据来建立异常检测模型。 ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • MATLAB函数重名问题解决方法及数据导入导出操作详解
    本文介绍了解决MATLAB函数重名的方法,并详细讲解了数据导入和导出的操作。包括使用菜单导入数据、在工作区直接新建变量、粘贴数据到.m文件或.txt文件并用load命令调用、使用save命令导出数据等方法。同时还介绍了使用dlmread函数调用数据的方法。通过本文的内容,读者可以更好地处理MATLAB中的函数重名问题,并掌握数据导入导出的各种操作。 ... [详细]
author-avatar
手机用户2502931221
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有