Package com.caucho.quercus.env

Examples of com.caucho.quercus.env.ArrayValueImpl


    return array;
  }

  public ArrayValue getINIEntries(Env env)
  {
    ArrayValue array = new ArrayValueImpl();

    for (ModuleInfo moduleInfo : env.getQuercus().getModules()) {
      Set<String> extensionSet = moduleInfo.getLoadedExtensions();

      if (extensionSet.contains(_name)) {
        IniDefinitions iniDefs = moduleInfo.getIniDefinitions();

        Set<Map.Entry<String, IniDefinition>> entrySet = iniDefs.entrySet();

        if (entrySet != null) {
          for (Map.Entry<String, IniDefinition> entry : entrySet) {
            array.put(StringValue.create(entry.getKey()),
                      entry.getValue().getValue(env));
          }
        }
      }
    }
View Full Code Here


    */
    //} else {
      value = env.getVar(_name);

      if (value == null) {
        value = new ArrayValueImpl();

        env.setValue(_name, value);
      }
      else {
        value = value.toAutoArray();
View Full Code Here

    Value value = env.getVar(varName);

    if (value != null)
      return value.getArray();
    else {
      ArrayValue array = new ArrayValueImpl();

      env.setRef(varName, array);

      return array;
    }
View Full Code Here

   */
  public Value evalArray(Env env)
  {
    Value obj = _expr.evalArray(env);

    ArrayValue array = new ArrayValueImpl();
   
    obj.put(array);
   
    return array;
  }
View Full Code Here

    return array;
  }

  public ArrayValue getClasses(Env env)
  {
    ArrayValue array = new ArrayValueImpl();

    HashSet<String> exts = env.getModuleContext().getExtensionClasses(_name);

    if (exts != null) {
      for (String name : exts) {
        array.put(StringValue.create(name),
                  env.wrapJava(new ReflectionClass(env, name)));
      }
    }

    return array;
View Full Code Here

    return array;
  }

  public ArrayValue getClassNames(Env env)
  {
    ArrayValue array = new ArrayValueImpl();

    HashSet<String> exts = env.getModuleContext().getExtensionClasses(_name);

    if (exts != null) {
      for (String name : exts) {
        array.put(name);
      }
    }

    return array;
  }
View Full Code Here

    return _fun.isReturnsReference();
  }
 
  public ArrayValue getParameters(Env env)
  {
    ArrayValue array = new ArrayValueImpl();
   
    Arg []args = _fun.getArgs();
   
    for (int i = 0; i < args.length; i++) {
      array.put(env.wrapJava(new ReflectionParameter(_fun, args[i])));
    }
   
    return array;
  }
View Full Code Here

    }

    switch (mode) {
    case 0:
      {
        ArrayValue result = new ArrayValueImpl();

        for (int i = 0; i < count.length; i++) {
          result.put(LongValue.create(i), LongValue.create(count[i]));
        }

        return result;
      }

    case 1:
      {
        ArrayValue result = new ArrayValueImpl();

        for (int i = 0; i < count.length; i++) {
          if (count[i] > 0)
            result.put(LongValue.create(i), LongValue.create(count[i]));
        }

        return result;
      }

    case 2:
      {
        ArrayValue result = new ArrayValueImpl();

        for (int i = 0; i < count.length; i++) {
          if (count[i] == 0)
            result.put(LongValue.create(i), LongValue.create(count[i]));
        }

        return result;
      }
View Full Code Here

      env.warning(L.l("Delimiter is empty"));
      return BooleanValue.FALSE;
    }
   
    int head = 0;   
    ArrayValue array = new ArrayValueImpl();

    int separatorLength = separator.length();
    int stringLength = string.length();
    long ulimit;
   
    if (limit >= 0) {
      ulimit = limit;     
    } else {
      ulimit = 0x7fffffff;
    }

    for (int i = 0; i < stringLength; ++i) {
     
      if (ulimit <= array.getSize() + 1) {
        break;
      }
     
      if (string.regionMatches(i, separator, 0, separatorLength)) {

        StringValue chunk = string.substring(head, i);
        array.append(chunk);
       
        head = i + separatorLength;
        i = head - 1;
      }
    }

    StringValue chunk = string.substring(head);

    array.append(chunk);
   
    while (array.getSize() > 0 && limit++ < 0) {
      array.pop(env);
    }

    return array;
  }
View Full Code Here

    */
  }
 
  public ArrayValue getMethods(Env env)
  {
    ArrayValue array = new ArrayValueImpl();
   
    MethodMap<AbstractFunction> map = _cls.getMethodMap();
   
    for (AbstractFunction method : map.values()) {
      array.put(env.wrapJava(new ReflectionMethod(_cls.getName(), method)));
    }
   
    return array;
  }
View Full Code Here

TOP

Related Classes of com.caucho.quercus.env.ArrayValueImpl

Copyright © 2018 www.massapicom. 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.