org.luaj.vm2.LuaTable.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(121)

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

LuaTable.<init>介绍

[英]Construct empty table
[中]构造空表

代码示例

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

/** Construct a {@link LuaTable} initialized with supplied array values. 
 * @param varargs {@link Varargs} containing the values to use in initialization
 * @param firstarg the index of the first argument to use from the varargs, 1 being the first.
 * @return new {@link LuaTable} instance with sequential elements coming from the varargs. 
 */
public static LuaTable tableOf(Varargs varargs, int firstarg) { return new LuaTable(varargs,firstarg); }

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

/** Construct a {@link LuaTable} initialized with supplied array values. 
 * @param unnamedValues array of {@link LuaValue} containing the values to use in initialization
 * @return new {@link LuaTable} instance with sequential elements coming from the array. 
 */
public static LuaTable listOf(LuaValue[] unnamedValues) { return new LuaTable(null,unnamedValues,null); }

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

/** Construct a {@link LuaTable} initialized with supplied named values and sequential elements.
 * The named values will be assigned first, and the sequential elements will be assigned later,
 * possibly overwriting named values at the same slot if there are conflicts.  
 * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization
 * in order {@code {key-a, value-a, key-b, value-b, ...} }
 * @param unnamedValues array of {@link LuaValue} containing the sequenctial elements to use in initialization
 * in order {@code {value-1, value-2, ...} }, or null if there are none
 * @return new {@link LuaTable} instance with named and sequential values supplied. 
 */
public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues) {return new LuaTable(namedValues,unnamedValues,null); }

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

/** Construct a {@link LuaTable} initialized with supplied array values. 
 * @param unnamedValues array of {@link LuaValue} containing the first values to use in initialization
 * @param lastarg {@link Varargs} containing additional values to use in initialization
 * to be put after the last unnamedValues element
 * @return new {@link LuaTable} instance with sequential elements coming from the array and varargs. 
 */
public static LuaTable listOf(LuaValue[] unnamedValues,Varargs lastarg) { return new LuaTable(null,unnamedValues,lastarg); }

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

/** Construct an empty {@link LuaTable} preallocated to hold array and hashed elements 
 * @param narray Number of array elements to preallocate
 * @param nhash Number of hash elements to preallocate
 * @return new {@link LuaTable} instance with no values and no metatable, but preallocated for array and hashed elements.
 */
public static LuaTable tableOf(int narray, int nhash) { return new LuaTable(narray, nhash); }

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

/** Construct a {@link LuaTable} initialized with supplied array values. 
 * @param unnamedValues array of {@link LuaValue} containing the first values to use in initialization
 * @param lastarg {@link Varargs} containing additional values to use in initialization
 * to be put after the last unnamedValues element
 * @return new {@link LuaTable} instance with sequential elements coming from the array and varargs. 
 */
public static LuaTable listOf(LuaValue[] unnamedValues,Varargs lastarg) { return new LuaTable(null,unnamedValues,lastarg); }

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

/** Construct a {@link LuaTable} initialized with supplied named values and sequential elements in an array part and as varargs.
 * The named values will be assigned first, and the sequential elements will be assigned later,
 * possibly overwriting named values at the same slot if there are conflicts.  
 * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization
 * in order {@code {key-a, value-a, key-b, value-b, ...} }
 * @param unnamedValues array of {@link LuaValue} containing the first sequenctial elements to use in initialization
 * in order {@code {value-1, value-2, ...} }, or null if there are none
 * @param lastarg {@link Varargs} containing additional values to use in the sequential part of the initialization, 
 * to be put after the last unnamedValues element
 * @return new {@link LuaTable} instance with named and sequential values supplied. 
 */
public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues, Varargs lastarg) {return new LuaTable(namedValues,unnamedValues,lastarg); }

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

/** Construct a {@link LuaTable} initialized with supplied named values. 
 * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization
 * in order {@code {key-a, value-a, key-b, value-b, ...} }
 * @return new {@link LuaTable} instance with non-sequential keys coming from the supplied array. 
 */
public static LuaTable tableOf(LuaValue[] namedValues) { return new LuaTable(namedValues,null,null); }

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

/** Construct a {@link LuaTable} initialized with supplied named values and sequential elements in an array part and as varargs.
 * The named values will be assigned first, and the sequential elements will be assigned later,
 * possibly overwriting named values at the same slot if there are conflicts.  
 * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization
 * in order {@code {key-a, value-a, key-b, value-b, ...} }
 * @param unnamedValues array of {@link LuaValue} containing the first sequenctial elements to use in initialization
 * in order {@code {value-1, value-2, ...} }, or null if there are none
 * @param lastarg {@link Varargs} containing additional values to use in the sequential part of the initialization, 
 * to be put after the last unnamedValues element
 * @return new {@link LuaTable} instance with named and sequential values supplied. 
 */
public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues, Varargs lastarg) {return new LuaTable(namedValues,unnamedValues,lastarg); }

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
public LuaValue getSetupOptions() {
  LuaTable options = new LuaTable();
  return options;
}

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
public LuaValue getSetupOptions() {
  LuaTable options = new LuaTable();
  options.set("lang", "en");
  return options;
}

代码示例来源:origin: Tencent/RapidView

@Override
public LuaTable getEnv(){
  LuaTable table = new LuaTable();
  for( Map.Entry<String, String> entry : mMapEnvironment.entrySet() ){
    table.set(LuaString.valueOf(entry.getKey()), LuaString.valueOf(entry.getValue()));
  }
  return table;
}

代码示例来源:origin: Tencent/RapidView

@Override
public LuaTable getEnv(){
  LuaTable table = new LuaTable();
  for( Map.Entry<String, String> entry : mMapEnvironment.entrySet() ){
    table.set(LuaString.valueOf(entry.getKey()), LuaString.valueOf(entry.getValue()));
  }
  return table;
}

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
  public LuaValue getSetupOptions() {
    LuaTable table = new LuaTable();
    // https://www.mediawiki.org/wiki/Manual:$wgMaxArticleSize
    // stringLengthLimit = $wgMaxArticleSize * 1024;
    table.set("stringLengthLimit",  2048 * 1024);
    table.set("patternLengthLimit", 10000);
    return table;
  }
}

代码示例来源:origin: com.aerospike/aerospike-client

public LuaValue call(LuaValue env) {
  LuaTable meta = new LuaTable();
  meta.set("__index", new index());
  LuaTable table = new LuaTable();
  table.setmetatable(meta);
  instance.registerPackage("aerospike", table);
  return table;
}

代码示例来源:origin: Tencent/RapidView

private static LuaTable arrayToTable(Object[] arrayObj){
    LuaTable table = new LuaTable();

    for( int i = 0; i < arrayObj.length; i++ ){
      table.set( LuaInteger.valueOf( i + 1), CoerceJavaToLua.coerce(arrayObj[i]));
    }

    return table;
  }
}

代码示例来源:origin: com.aerospike/aerospike-client

public LuaValue call(LuaValue env) {
  LuaTable meta = new LuaTable(0,1);
  meta.set("__tostring", new tostring());
  LuaTable table = new LuaTable(0,10);
  table.setmetatable(meta);
  table.set("read", new read());
  table.set("readable", new readable());
  table.set("writeable", new writeable());
  table.set("write", new write());
  instance.registerPackage("stream", table);
  return table;
}

代码示例来源:origin: Tencent/RapidView

@Override
public LuaValue call(LuaValue var1, LuaValue var2) {
  LuaTable functions = new LuaTable();
  functions.set("getRapidView", new GetPhotonView());
  functions.set("getJavaBridge", new GetJavaBridge());
  functions.set("getEnvironment", new GetEnvironment());
  var2.set("rapid", functions);
  var2.get("package").get("loaded").set("rapid", functions);
  return functions;
}

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
public LuaTable getInterface() {
  LuaTable table = new LuaTable();
  table.set("getNsIndex", getNsIndex());
  table.set("pagesInCategory", pagesInCategory());
  table.set("pagesInNamespace", pagesInNamespace());
  table.set("usersInGroup", usersInGroup());
  table.set("interwikiMap", interwikiMap());
  return table;
}

代码示例来源:origin: info.bliki.wiki/bliki-core

@Override
public LuaTable getInterface() {
  LuaTable table = new LuaTable();
  table.set("unstrip", unstrip());
  table.set("unstripNoWiki", unstripNoWiki());
  table.set("killMarkers", killMarkers());
  table.set("getEntityTable", getEntityTable());
  table.set("jsonEncode", jsonEncode());
  table.set("jsonDecode", jsonDecode());
  return table;
}

相关文章

微信公众号

最新文章

更多