当前位置: 首页>>代码示例>>Java>>正文


Java V8Array.length方法代码示例

本文整理汇总了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();
}
 
开发者ID:LiuHongtao,项目名称:JustDraw,代码行数:10,代码来源:JCDemoActivity.java

示例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();
}
 
开发者ID:LiuHongtao,项目名称:JustDraw,代码行数:12,代码来源:JustContext.java

示例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(); } };");
    }
 
开发者ID:timomer,项目名称:HAPP,代码行数:15,代码来源:DetermineBasalAdapterJS.java

示例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};");
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:16,代码来源:DetermineBasalAdapterJS.java

示例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();
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:8,代码来源:V8Context.java

示例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;
}
 
开发者ID:michel-kraemer,项目名称:citeproc-java,代码行数:19,代码来源:V8ScriptRunner.java


注:本文中的com.eclipsesource.v8.V8Array.length方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。