本文整理汇总了Java中com.eclipsesource.v8.V8Array.length方法的典型用法代码示例。如果您正苦于以下问题:Java V8Array.length方法的具体用法?Java V8Array.length怎么用?Java V8Array.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.eclipsesource.v8.V8Array
的用法示例。
在下文中一共展示了V8Array.length方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jcdemo
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private void jcdemo(V8Array parameters) {
V8Array calls = parameters.getArray(0);
int length = calls.length();
for (int i = 0; i < length; i++) {
jsdemo.call(calls.getObject(i));
}
justView.draw(jsdemo.getShapeList());
jsdemo.clearShapeList();
}
示例2: setLineDash
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
public void setLineDash(V8Array intervals) {
float[] floatIntervals = new float[intervals.length()];
for (int i = 0; i < intervals.length(); i++) {
floatIntervals[i] = (float)((double)intervals.getDouble(i));
}
PathEffect effects = new DashPathEffect(floatIntervals, 1);
mPaintStroke.setPathEffect(effects);
intervals.release();
}
示例3: initProcessExitCallback
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private void initProcessExitCallback() {
JavaVoidCallback callbackProccessExit = new JavaVoidCallback() {
@Override
public void invoke(V8Object arg0, V8Array parameters) {
if (parameters.length() > 0) {
Object arg1 = parameters.get(0);
log.error("ProccessExit " + arg1);
// mV8rt.executeVoidScript("return \"\";");
}
}
};
mV8rt.registerJavaMethod(callbackProccessExit, "proccessExit");
mV8rt.executeVoidScript("var process = {\"exit\": function () { proccessExit(); } };");
}
示例4: initLogCallback
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private void initLogCallback() {
JavaVoidCallback callbackLog = new JavaVoidCallback() {
@Override
public void invoke(V8Object arg0, V8Array parameters) {
if (parameters.length() > 0) {
Object arg1 = parameters.get(0);
log.debug("JSLOG " + arg1);
}
}
};
mV8rt.registerJavaMethod(callbackLog, "log");
mV8rt.executeVoidScript("var console = {\"log\":log, \"error\":log};");
}
示例5: problems
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private List<AssetProblem> problems(final V8Array array) {
ImmutableList.Builder<AssetProblem> result = ImmutableList.builder();
for (int i = 0; i < array.length(); i++) {
result.add(problem(register(array.getObject(i))));
}
return result.build();
}
示例6: convertArray
import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
/**
* Recursively convert a V8 array to a list and release it
* @param arr the array to convert
* @return the list
*/
private List<Object> convertArray(V8Array arr) {
List<Object> l = new ArrayList<>();
for (int i = 0; i < arr.length(); ++i) {
Object o = arr.get(i);
if (o instanceof V8Array) {
o = convert((V8Array)o, List.class);
} else if (o instanceof V8Object) {
o = convert((V8Object)o, Map.class);
}
l.add(o);
}
return l;
}