fixes for moving ibex.js to collections
[org.ibex.xt-crawshaw.git] / src / java / ibex / xt / Prevalence.java
index ce60a19..79a6952 100644 (file)
@@ -73,25 +73,25 @@ public class Prevalence {
         public static final long serialVersionUid = 0xfb2aa281;
         private JS js;
         JSScope newscope;
-        Vec v;
+        List v;
         public JSTransaction(JS js) throws JSExn {
             newscope = new JSScope(null);
             this.js = JS.cloneWithNewParentScope(js, newscope);
             v = JS.getFormalArgs(this.js);
             for(int i=0; i<v.size(); i++) {
-                if ("prevalent".equals(v.elementAt(i))) continue;
-                newscope.put(v.elementAt(i), JS.getParentScope(js).get(v.elementAt(i)));
+                if ("prevalent".equals(v.get(i))) continue;
+                newscope.put(v.get(i), JS.getParentScope(js).get(v.get(i)));
             }
         }
         public void executeOn(Object o, Date now) {
             try {
                 newscope.put("prevalent", o);
                 newscope.put("now", new JSDate(now.getTime()));
-                Object a = v.size() <= 0 ? null : newscope.get(v.elementAt(0));
-                Object b = v.size() <= 1 ? null : newscope.get(v.elementAt(1));
-                Object c = v.size() <= 2 ? null : newscope.get(v.elementAt(2));
+                Object a = v.size() <= 0 ? null : newscope.get(v.get(0));
+                Object b = v.size() <= 1 ? null : newscope.get(v.get(1));
+                Object c = v.size() <= 2 ? null : newscope.get(v.get(2));
                 Object[] rest = v.size() <= 3 ? null : new Object[v.size() - 3];
-                for(int i=3; i<v.size(); i++) rest[i-3] = v.elementAt(i);
+                for(int i=3; i<v.size(); i++) rest[i-3] = v.get(i);
                 js.call(a, b, c, rest, v.size());
             } catch (Exception e) { throw new RuntimeException(e); }
         }