Package com.scratchdisk.list

Examples of com.scratchdisk.list.List


  }

  @SuppressWarnings("unchecked")
  public void put(int index, Scriptable start, Object value) {
    if (javaObject != null && javaObject instanceof List) {
      List list = ((List) javaObject);
      int size = list.size();
      value = coerceComponentType(value);
      if (index >= size) {
        for (int i = size; i < index; i++)
          list.add(i, null);
        list.add(index, value);
      } else {
        list.set(index, value);
      }
      if (changeReceiver != null)
        updateChangeReceiver();
    }
  }
View Full Code Here


            int length = ScriptRuntime.toInt32(d);
            if (length != d) {
                String msg = ScriptRuntime.getMessage0("msg.arraylength.bad");
                throw ScriptRuntime.constructError("RangeError", msg);
            }
        List list = ((List) javaObject);
        int size = list.size();
        if (length < size) {
          list.remove(length, size);
        } else {
          for (int i = size; i < length; i++)
            list.add(null);
        }
      } else if (javaObject instanceof StringIndexList
          && !members.has(name, false)) {
        ((StringIndexList) javaObject).put(name, coerceComponentType(value));
        return;
View Full Code Here

TOP

Related Classes of com.scratchdisk.list.List

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.