So it has to be java-centric:

strArrayClassName = "[Ljava.lang.Integer;"
myClas = Class.forName( strArrayClassName )

as for example.

No jython sugar about it ....

Nicola


Magnus.Lambert@ppm.nu wrote:
Meddelande
I think it is the equivalent, if you for instance from java call a jython function returning an Integer[] it
will cast the PyArray to an Integer[] I guess. If not another solution could be:
 
>>> import java.util.ArrayList
>>> import java.lang.Integer
>>> b = java.util.ArrayList()
>>> b.toArray(zeros(0, java.lang.Integer))
array([], java.lang.Integer)                                                            # Looks like a java Integer[]
>>> b.toArray(zeros(0, java.lang.Integer)).__class__
<jclass org.python.core.PyArray at 5174563>                                #  wrapped in PyArray
 
But it generates the same result in a more comlicated way. more javacentric than pythonic
 
check http://www.jython.org/docs/javadoc/org/python/core/PyArray.html
 
Since Integer[] is not an python type it will always be wrapped in PyArray.
 
// Magnus
 
 
 
-----Ursprungligt meddelande-----
Från: Nicola de Candussio [mailto:ndecandu@rssd.esa.int]
Skickat: den 3 februari 2004 11:19
Till: Magnus.Lambert@ppm.nu
Kopia: jython-users@lists.sourceforge.net
Ämne: Re: SV: [Jython-users] Array class instances

Hi Magnus,
thanks a lot but the actual resulting class is

org.python.core.PyArray

which is the wrapper class for java array I guess ...

Nicola

Magnus.Lambert@ppm.nu wrote:
Check http://www.jython.org/docs/jarray.html , see examples at the bottom of
the page.

  
from java.lang import Integer
from jarray import zeros, array
i = zeros(3, Integer)				# Integer i[] = new
        
Integer[3];
  
i = array([], Integer).__class__		# Class i = Integer[].class
        

// Magnus

-----Ursprungligt meddelande-----
Från: Nicola de Candussio [mailto:ndecandu@rssd.esa.int] 
Skickat: den 3 februari 2004 10:00
Till: jython-users@lists.sourceforge.net
Ämne: [Jython-users] Array class instances


Hi all,

do you now if it is possible to generate the equivalent of this java 
declaration

Class i = Integer[].class

in jython ??
i.e. is it possible to generate instances of  java.lang.Class ? the
following

from java.lang import Integer
i = Integer[]

does not work .....

Trying to get an object of that type and access its class definition 
does not work either

from java.lang.reflect import Array
a = Array.newInstance(Integer, 1)
# NO !!
a.getClass()

any suggestion ???

Thanks in advance


Nicola



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the
breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users