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

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

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

Function.concatenateVarArgs介绍

[英]Concatenate varargs with normal args to obtain a simple argument array.
[中]将varargs与普通args串联以获得一个简单的参数数组。

代码示例

代码示例来源: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

inArgs = Function.concatenateVarArgs(inArgs);

代码示例来源: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

inArgs = Function.concatenateVarArgs(inArgs);

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

inArgs = Function.concatenateVarArgs(inArgs);

相关文章