com.sun.jna.Function.valueOf()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(216)

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

Function.valueOf介绍

[英]Implementation of Boolean.valueOf for older VMs.
[中]布尔函数的实现。旧VM的值。

代码示例

代码示例来源:origin: net.java.dev.jna/jna

/** Chain invocation to the native function. */
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    String str = "Proxy interface to " + function;
    Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD);
    Class<?> cls = findCallbackClass(m.getDeclaringClass());
    str += " (" + cls.getName() + ")";
    return str;
  } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return Integer.valueOf(hashCode());
  } else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Function.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: net.java.dev.jna/jna

Object o = inArgs[0];
if (o != null && Proxy.isProxyClass(o.getClass())) {
  return Function.valueOf(Proxy.getInvocationHandler(o) == this);

代码示例来源:origin: net.java.dev.jna/jna

result = null;
} else if (returnType==boolean.class || returnType==Boolean.class) {
  result = valueOf(Native.invokeInt(this, this.peer, callFlags, args) != 0);
} else if (returnType==byte.class || returnType==Byte.class) {
  result = Byte.valueOf((byte)Native.invokeInt(this, this.peer, callFlags, args));

代码示例来源:origin: net.java.dev.jna/jna

value = Function.valueOf(((Number)value).intValue() != 0);

代码示例来源:origin: net.java.dev.jna/jna

result = Function.valueOf(getInt(offset) != 0);
} else if (type == byte.class || type == Byte.class) {
  result =  Byte.valueOf(getByte(offset));

代码示例来源:origin: com.sun.jna/jna

/** Chain invocation to the native function. */
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    return "Proxy interface to " + function;
  }
  else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return new Integer(hashCode());
  }
  else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Boolean.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: org.elasticsearch/jna

/** Chain invocation to the native function. */
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  if (Library.Handler.OBJECT_TOSTRING.equals(method)) {
    String str = "Proxy interface to " + function;
    Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD);
    Class<?> cls = findCallbackClass(m.getDeclaringClass());
    str += " (" + cls.getName() + ")";
    return str;
  } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) {
    return Integer.valueOf(hashCode());
  } else if (Library.Handler.OBJECT_EQUALS.equals(method)) {
    Object o = args[0];
    if (o != null && Proxy.isProxyClass(o.getClass())) {
      return Function.valueOf(Proxy.getInvocationHandler(o) == this);
    }
    return Boolean.FALSE;
  }
  if (Function.isVarArgs(method)) {
    args = Function.concatenateVarArgs(args);
  }
  return function.invoke(method.getReturnType(), args, options);
}

代码示例来源:origin: org.elasticsearch/jna

Object o = inArgs[0];
if (o != null && Proxy.isProxyClass(o.getClass())) {
  return Function.valueOf(Proxy.getInvocationHandler(o) == this);

代码示例来源:origin: com.sun.jna/jna

Object o = inArgs[0];
if (o != null && Proxy.isProxyClass(o.getClass())) {
  return Boolean.valueOf(Proxy.getInvocationHandler(o) == this);

代码示例来源:origin: com.sun.jna/jna

value = Boolean.valueOf(((Number)value).intValue() != 0);

代码示例来源:origin: org.elasticsearch/jna

result = null;
} else if (returnType==boolean.class || returnType==Boolean.class) {
  result = valueOf(Native.invokeInt(this, this.peer, callFlags, args) != 0);
} else if (returnType==byte.class || returnType==Byte.class) {
  result = Byte.valueOf((byte)Native.invokeInt(this, this.peer, callFlags, args));

代码示例来源:origin: org.elasticsearch/jna

value = Function.valueOf(((Number)value).intValue() != 0);

代码示例来源:origin: org.elasticsearch/jna

result = Function.valueOf(getInt(offset) != 0);
} else if (type == byte.class || type == Byte.class) {
  result =  Byte.valueOf(getByte(offset));

代码示例来源:origin: com.sun.jna/jna

result = Boolean.valueOf(invokeInt(callingConvention, args) != 0);

相关文章