Swig:如何获得一个";“产出”;Java中的整数,而不是;数组";?

Swig:如何获得一个";“产出”;Java中的整数,而不是;数组";?,java,arrays,output,swig,Java,Arrays,Output,Swig,我打算使用Javaint a_output,因此我执行以下操作: 示例.h: void fooA(int *a_output); %module sample %{ #include "sample.h" %} %include "typemaps.i" %apply int *OUTPUT { int *a_output }; %include "sample.h" 示例。i: void fooA(int *a_output); %module sample %{ #inc

我打算使用Java
int a_output
,因此我执行以下操作:

示例.h

void fooA(int *a_output);
%module sample
%{
   #include "sample.h"
%}
%include "typemaps.i"
%apply int *OUTPUT { int *a_output };

%include "sample.h"
示例。i

void fooA(int *a_output);
%module sample
%{
   #include "sample.h"
%}
%include "typemaps.i"
%apply int *OUTPUT { int *a_output };

%include "sample.h"
但是在Java中我得到一个数组:
int[]a\u输出

我应该如何修改我的Swig接口以获得
int
?因为这是函数fooA的输出,而不是数组

多谢各位

编辑:


如果参数将在
fooA
函数之外过期,那么在Java中将参数转换为
int a_output
可能不是一个好主意。因此,我还需要您的建议,告诉我如何用Java将其转换为最佳形式

这是java?McKoCh Switg是一个JC++接口,用于在C++和java(以及其他语言)之间进行交互。java在Sistg支持的列表中没有看到关键字Java。languages@G我明白了。我猜你每天都会学到新东西!你能解释一下为什么
int fooA()
不适用于你的情况吗?