This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to access elements of java array?


Greetings once more,

  This time I have got a problem getting elements of a plain Java
  array. I am trying to get elements of a plain java array in
  following code:

(let* (
 (doc-parts (invoke
              (as <org.outerj.daisy.repository.Parts>
                (invoke doc 'getParts))        
              'getArray)))
  (log-info (array? doc-parts)) ; says false
  (array-ref doc-parts 0) ; throws exception, below
)

Invalid parameter, was: [Lorg.outerj.daisy.repository.Part;
java.lang.ClassCastException: [Lorg.outerj.daisy.repository.Part;
			      at
  gnu.kawa.functions.ArrayRef.applyN(ArrayRef.java:34)
  at gnu.mapping.ProcedureN.apply2(ProcedureN.java:39)
  at gnu.kawa.functions.ArrayRef.apply2(ArrayRef.java:28)
  at atInteractiveLevel$8.dsyCheckout(dsy.scm:58)
  at atInteractiveLevel$8.apply0(dsy.scm:40)


 the getParts method of the instance referred by doc variable returns
  Part[] array.


  What is the right way to access, get, set elements of plain java
  arrays returned from the Java code?

With best regards,
-- 
Victor Anyakin                         ()  ascii ribbon campaign
                                       /\    - against html mail


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]