Examples of LuaValue


Examples of org.luaj.vm2.LuaValue

         * @param $interwiki    string Interwiki code
         */
        return new LibFunction() {
            @Override
            public Varargs invoke(Varargs args) {
                LuaValue ns    = args.arg(1);
                LuaValue title = args.arg(2);
                LuaValue fragment = args.arg(3);
                LuaValue interwiki = args.arg(4);
                return title(ns, title, fragment, interwiki);
            }
        };
    }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

      readBytes(nameSize);
      String name = Buffer.utf8ToString(receiveBuffer, 0, nameSize);
 
      int particleBytesSize = (int) (opSize - (4 + nameSize));
      readBytes(particleBytesSize);
      LuaValue aggregateValue = instance.getValue(particleType, receiveBuffer, 0, particleBytesSize);
           
      if (! name.equals("SUCCESS")) {
        throw new AerospikeException("Query aggregate expected bin name SUCCESS.  Received " + name);
      }
     
View Full Code Here

Examples of org.luaj.vm2.LuaValue

    public Varargs invoke(Varargs args) {
      LuaList list = new LuaList(instance, new ArrayList<LuaValue>());
     
      if (args.istable(2)) {
        LuaTable table = args.checktable(2);
        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           list.append(v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {list});
    }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

    public Varargs invoke(Varargs args) {
      LuaMap map = new LuaMap(instance, new HashMap<LuaValue,LuaValue>());
     
      if (args.istable(2)) {
        LuaTable table = args.checktable(2);
        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           map.put(k, v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {map});
    }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

      readBytes(nameSize);
      String name = Buffer.utf8ToString(dataBuffer, 0, nameSize);
 
      int particleBytesSize = (int) (opSize - (4 + nameSize));
      readBytes(particleBytesSize);
      LuaValue aggregateValue = instance.getValue(particleType, dataBuffer, 0, particleBytesSize);
           
      if (! name.equals("SUCCESS")) {
        throw new AerospikeException("Query aggregate expected bin name SUCCESS.  Received " + name);
      }
     
View Full Code Here

Examples of org.luaj.vm2.LuaValue

        else {
          throw new AerospikeException(ResultCode.QUERY_GENERIC, "Query aggregate expected bin name SUCCESS.  Received " + name);
        }
      }
     
      LuaValue aggregateValue = instance.getLuaValue(particleType, dataBuffer, 0, particleBytesSize);
                 
      if (! valid) {
        throw new AerospikeException.QueryTerminated();
      }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

  public LuaMap getLuaMap(Map<?,?> map) {
    Map<LuaValue,LuaValue> luaMap = new HashMap<LuaValue,LuaValue>(map.size());
   
    for (Map.Entry<?,?> entry : map.entrySet()) {
      LuaValue key = getLuaValue(entry.getKey());
      LuaValue value = getLuaValue(entry.getValue());
      luaMap.put(key, value);
    }
    return new LuaMap(this, luaMap);   
  }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

    public Varargs invoke(Varargs args) {
      LuaList list = new LuaList(instance, new ArrayList<LuaValue>());
     
      if (args.istable(2)) {
        LuaTable table = args.checktable(2);
        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           list.append(v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {list});
    }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

    public Varargs invoke(Varargs args) {
      LuaMap map = new LuaMap(instance, new HashMap<LuaValue,LuaValue>());
     
      if (args.istable(2)) {
        LuaTable table = args.checktable(2);
        LuaValue k = LuaValue.NIL;
       
        while (true) {
           Varargs n = table.next(k);
          
           if ((k = n.arg1()).isnil())
             break;

           LuaValue v = n.arg(2);
           map.put(k, v);
         }
      }       
      return LuaValue.varargsOf(new LuaValue[] {map});
    }
View Full Code Here

Examples of org.luaj.vm2.LuaValue

    _G = JsePlatform.standardGlobals();
  }
 
  public void testJavaIntToLuaInt() {
    Integer i = Integer.valueOf(777);
    LuaValue v = CoerceJavaToLua.coerce(i);
    assertEquals( LuaInteger.class, v.getClass() );
    assertEquals( 777, v.toint() );
  }
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.