How to fetch passed in reference array object

View: New views
2 Messages — Rating Filter:   Alert me  

How to fetch passed in reference array object

by Bidda Gowda :: Rate this Message:

| View Threaded | Show Only this Message

Hi,
I am trying to integrate my python program with Java program which
comes in the form of jar. I am able to create an instance of a java
class and also call a method. Below is a function signature of same
instance method.

public int JavaInstanceMethod( int FirstArg, int SecArg, char[] ThirdArg)

This method should return int and also writes something into ThirdArg buffer.

When i call this method in python using jype, JavaInstanceMethod
returns me the proper int value. However i am not sure how to fetch
the ThirdArg.

I tried to pass an empty list object as ThirdArg. But nothing gets
appended to the same list object after this JavaInstanceMethod call.

Is it possible to pass in an reference char Array object to
JavaInstanceMethod and fetch the modified object ?

--
Bidda

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Jpype-users mailing list
Jpype-users@...
https://lists.sourceforge.net/lists/listinfo/jpype-users

Re: How to fetch passed in reference array object

by Steve Ménard :: Rate this Message:

| View Threaded | Show Only this Message

You can use JArray classes to perform this.

JArray objects behave almost exactly like regular Java lists, but they are typed and keep the backing java array when passed as parameters.

Steve Menard

------------------------------
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
    Rick Cook, The Wizardry Compiled
------
There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.
-- Jeremy S. Anderson


On Wed, Sep 1, 2010 at 5:22 AM, Bidda Gowda <bidda.gowda@...> wrote:
Hi,
I am trying to integrate my python program with Java program which
comes in the form of jar. I am able to create an instance of a java
class and also call a method. Below is a function signature of same
instance method.

public int JavaInstanceMethod( int FirstArg, int SecArg, char[] ThirdArg)

This method should return int and also writes something into ThirdArg buffer.

When i call this method in python using jype, JavaInstanceMethod
returns me the proper int value. However i am not sure how to fetch
the ThirdArg.

I tried to pass an empty list object as ThirdArg. But nothing gets
appended to the same list object after this JavaInstanceMethod call.

Is it possible to pass in an reference char Array object to
JavaInstanceMethod and fetch the modified object ?

--
Bidda

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Jpype-users mailing list
Jpype-users@...
https://lists.sourceforge.net/lists/listinfo/jpype-users


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Jpype-users mailing list
Jpype-users@...
https://lists.sourceforge.net/lists/listinfo/jpype-users