use of lucee.runtime.type.scope.ArgumentIntKey in project Lucee by lucee.
the class Map method invoke.
private static Array invoke(PageContext pc, Enumeration e, UDF udf, ExecutorService es, List<Future<Data<Object>>> futures) throws PageException {
Array rtn = new ArrayImpl();
Object v;
boolean async = es != null;
Object res;
int count = 0;
ArgumentIntKey k;
while (e.hasMoreElements()) {
v = e.nextElement();
k = ArgumentIntKey.init(++count);
res = _inv(pc, udf, new Object[] { v }, k, es, futures);
if (!async)
rtn.set(k, res);
}
return rtn;
}
use of lucee.runtime.type.scope.ArgumentIntKey in project Lucee by lucee.
the class Map method invoke.
private static Collection invoke(PageContext pc, List list, UDF udf, ExecutorService es, List<Future<Data<Object>>> futures) throws CasterException, PageException {
Array rtn = new ArrayImpl();
ListIterator it = list.listIterator();
boolean async = es != null;
Object res, v;
int index;
ArgumentIntKey k;
while (it.hasNext()) {
index = it.nextIndex();
k = ArgumentIntKey.init(index);
v = it.next();
res = _inv(pc, udf, new Object[] { v, Caster.toDoubleValue(k.getString()), list }, k, es, futures);
if (!async)
rtn.set(k, res);
}
return rtn;
}
use of lucee.runtime.type.scope.ArgumentIntKey in project Lucee by lucee.
the class Reduce method invoke.
private static Object invoke(PageContext pc, Enumeration e, UDF udf, Object initalValue) throws PageException {
Object v;
int count = 0;
ArgumentIntKey k;
while (e.hasMoreElements()) {
v = e.nextElement();
k = ArgumentIntKey.init(++count);
initalValue = udf.call(pc, new Object[] { initalValue, v }, true);
}
return initalValue;
}
use of lucee.runtime.type.scope.ArgumentIntKey in project Lucee by lucee.
the class Reduce method invoke.
private static Object invoke(PageContext pc, Iterator it, UDF udf, Object initalValue) throws PageException {
Object v;
int count = 0;
ArgumentIntKey k;
while (it.hasNext()) {
v = it.next();
k = ArgumentIntKey.init(++count);
initalValue = udf.call(pc, new Object[] { initalValue, v }, true);
}
return initalValue;
}
use of lucee.runtime.type.scope.ArgumentIntKey in project Lucee by lucee.
the class Some method invoke.
private static boolean invoke(PageContext pc, Iterator it, UDF udf, ExecutorService es, List<Future<Data<Object>>> futures) throws PageException {
Object v;
boolean async = es != null;
Object res;
int count = 0;
ArgumentIntKey k;
while (it.hasNext()) {
v = it.next();
k = ArgumentIntKey.init(++count);
res = _inv(pc, udf, new Object[] { v }, k, v, es, futures);
if (!async && Caster.toBooleanValue(res))
return true;
}
return false;
}
Aggregations