com.eclipsesource.v8.V8Array.getHandle()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中com.eclipsesource.v8.V8Array.getHandle()方法的一些代码示例,展示了V8Array.getHandle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。V8Array.getHandle()方法的具体详情如下:
包路径:com.eclipsesource.v8.V8Array
类名称:V8Array
方法名:getHandle

V8Array.getHandle介绍

暂无

代码示例

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the type of element at this given index.
 *
 * @param index The index at which to lookup the type of.
 *
 * @return The type of the element at the index.
 */
public int getType(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.getType(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Gets the type of the array. Returns a 'type' if all the elements in the array
 * have the same type, otherwise UNDEFINED is returned.
 *
 * @return The type of all the elements of the array, or UNDEFINED if they
 * are not all the same type.
 */
public int getType() {
  v8.checkThread();
  checkReleased();
  return v8.getArrayType(v8.getV8RuntimePtr(), getHandle());
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the length of this array.
 *
 * @return The length of the array.
 */
public int length() {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetSize(v8.getV8RuntimePtr(), getHandle());
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Pushes null to the next available spot in the Array. In
 * particular, this[length] = null;
 *
 * @return The receiver.
 */
public V8Array pushNull() {
  v8.checkThread();
  checkReleased();
  v8.addArrayNullItem(v8.getV8RuntimePtr(), getHandle());
  return this;
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Pushes undefined to the next available spot in the Array. In
 * particular, this[length] = undefined;
 *
 * @return The receiver.
 */
public V8Array pushUndefined() {
  v8.checkThread();
  checkReleased();
  v8.addArrayUndefinedItem(v8.getV8RuntimePtr(), getHandle());
  return this;
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the byte value associated at this index. If the value at
 * this index does not exist, or cannot be cast to a byte, then
 * V8ResultUndefined exception is thrown.
 *
 * @param index The index whose value to return
 * @return The byte value at this index or V8ResultUndefined
 * if the index does not exist or the value cannot be cast to a byte.
 */
public byte getByte(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetByte(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Pushes an integer value to the next available spot in the Array. In
 * particular, this[length] = value;
 *
 * @param value The value to push to the array.
 *
 * @return The receiver.
 */
public V8Array push(final int value) {
  v8.checkThread();
  checkReleased();
  v8.addArrayIntItem(v8.getV8RuntimePtr(), getHandle(), value);
  return this;
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Pushes a boolean value to the next available spot in the Array. In
 * particular, this[length] = value;
 *
 * @param value The value to push to the array.
 *
 * @return The receiver.
 */
public V8Array push(final boolean value) {
  v8.checkThread();
  checkReleased();
  v8.addArrayBooleanItem(v8.getV8RuntimePtr(), getHandle(), value);
  return this;
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Pushes a double value to the next available spot in the Array. In
 * particular, this[length] = value;
 *
 * @param value The value to push to the array.
 *
 * @return The receiver.
 */
public V8Array push(final double value) {
  v8.checkThread();
  checkReleased();
  v8.addArrayDoubleItem(v8.getV8RuntimePtr(), getHandle(), value);
  return this;
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the integer value associated at this index. If the value
 * at this index does not exist, or if it's not an integer, then
 * V8ResultUndefined exception is thrown.
 *
 * @param index The index whose value to return.
 *
 * @return The integer value at this index or V8ResultUndefined
 * if the index does not exist or the value is not an integer.
 */
public int getInteger(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetInteger(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the double value associated at this index. If the value
 * at this index does not exist, or if it's not a double, then
 * V8ResultUndefined exception is thrown.
 *
 * @param index The index whose value to return.
 *
 * @return The double value at this index or V8ResultUndefined
 * if the index does not exist or the value is not a double.
 */
public double getDouble(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetDouble(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the String value associated at this index. If the value
 * at this index does not exist, or if it's not a String, then
 * V8ResultUndefined exception is thrown.
 *
 * @param index The index whose value to return.
 *
 * @return The String value at this index or V8ResultUndefined
 * if the index does not exist or the value is not a String.
 */
public String getString(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetString(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the boolean value associated at this index. If the value
 * at this index does not exist, or if it's not a boolean, then
 * V8ResultUndefined exception is thrown.
 *
 * @param index The index whose value to return.
 *
 * @return The boolean value at this index or V8ResultUndefined
 * if the index does not exist or the value is not a boolean.
 */
public boolean getBoolean(final int index) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetBoolean(v8.getV8RuntimePtr(), getHandle(), index);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the booleans contained in a subset of a V8Array. If the subset
 * contains elements other than booleans, then a V8ResultUndefined exception
 * is thrown. Furthermore, if the subset is not entirely contained within the array,
 * then V8ResultUndefined exception is also thrown.
 *
 * @param index The starting index.
 * @param length The length.
 *
 * @return The booleans contained in the subset of the array, or V8ResultUndefined
 * exception.
 */
public boolean[] getBooleans(final int index, final int length) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetBooleans(v8.getV8RuntimePtr(), getHandle(), index, length);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Gets the type of a subset of the array. The subset is specified by a start index
 * and a length. UNDEFINED is returned if all the elements in the subset are not
 * of the same type.
 *
 * @param index The start index.
 * @param length The length.
 *
 * @return The type of the subset of the array or UNDEFINED if the subset is not
 * all the same type.
 */
public int getType(final int index, final int length) {
  v8.checkThread();
  checkReleased();
  return v8.getType(v8.getV8RuntimePtr(), getHandle(), index, length);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the integers contained in a subset of a V8Array. If the subset
 * contains elements other than integers, then a V8ResultUndefined exception
 * is thrown. Furthermore, if the subset is not entirely contained within the array,
 * then V8ResultUndefined exception is also thrown.
 *
 * @param index The starting index.
 * @param length The length.
 *
 * @return The integers contained in the subset of the array, or V8ResultUndefined
 * exception.
 */
public int[] getIntegers(final int index, final int length) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetIntegers(v8.getV8RuntimePtr(), getHandle(), index, length);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the Strings contained in a subset of a V8Array. If the subset
 * contains elements other than Strings, then a V8ResultUndefined exception
 * is thrown. Furthermore, if the subset is not entirely contained within the array,
 * then V8ResultUndefined exception is also thrown.
 *
 * @param index The starting index.
 * @param length The length.
 *
 * @return The Strings contained in the subset of the array, or V8ResultUndefined
 * exception.
 */
public String[] getStrings(final int index, final int length) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetStrings(v8.getV8RuntimePtr(), getHandle(), index, length);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Returns the bytes contained in a subset of a V8Array. If the subset
 * contains elements that cannot be cast to bytes, then a V8ResultUndefined exception
 * is thrown. Furthermore, if the subset is not entirely contained within the array,
 * then V8ResultUndefined exception is also thrown.
 *
 * @param index The starting index.
 * @param length The length.
 *
 * @return The bytes contained in the subset of the array, or V8ResultUndefined
 * exception.
 */
public byte[] getBytes(final int index, final int length) {
  v8.checkThread();
  checkReleased();
  return v8.arrayGetBytes(v8.getV8RuntimePtr(), getHandle(), index, length);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Invokes a JavaScript function which does not return a result.
 *
 * @param name The name of the JS Function to call.
 *
 * @param parameters The parameters to pass to the function. Parameters must be released.
 */
public void executeVoidFunction(final String name, final V8Array parameters) {
  v8.checkThread();
  checkReleased();
  v8.checkRuntime(parameters);
  long parametersHandle = parameters == null ? 0 : parameters.getHandle();
  v8.executeVoidFunction(v8.getV8RuntimePtr(), objectHandle, name, parametersHandle);
}

代码示例来源:origin: eclipsesource/J2V8

/**
 * Invoke a JavaScript function and return the result as a Java Object.
 *
 * @param name The name of the JS Function to call.
 *
 * @param parameters The parameters to pass to the function. Parameters must be released.
 *
 * @return A Java Object representing the result of the function call.
 */
public Object executeFunction(final String name, final V8Array parameters) {
  v8.checkThread();
  checkReleased();
  v8.checkRuntime(parameters);
  long parametersHandle = parameters == null ? 0 : parameters.getHandle();
  return v8.executeFunction(v8.getV8RuntimePtr(), UNKNOWN, objectHandle, name, parametersHandle);
}

相关文章