[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #41239] Dot notation for accessing Java static

From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #41239] Dot notation for accessing Java static class fields
Date: Thu, 16 Jan 2014 16:07:23 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0

Follow-up Comment #3, bug #41239 (project octave):

Tried your suggestion, but alas: it is not going to work, unless with undue

In Octave-4.1.0+

>> cl = javaObject ('org.apache.poi.ss.usermodel.Cell')
error: [java] java.lang.NoSuchMethodException:

...mayby happening because Cell is an interface rather than a class. The
derived classes (that do have constructors) are protected, thus inaccessible.
In Matlab it doesn't work either:

>> cl = javaObject ('org.apache.poi.ss.usermodel.Cell')
Error using javaObject
No constructor with appropriate signature exists
in Java class org.apache.poi.ss.usermodel.Cell

Creating a Cell won't work that easily, because:
- to be able to create a Cell a Row is needed;
- to be able to create a Row, a Worksheet is needed;
- to be able to create a Worksheet, a Workbook (spreadsheet) is needed.
Once that one scheme works (can be done), the static field values can only be
accessed one by one each for a new Cell, as each Cell is typed. So that'll
clobber up new worksheets.

In conclusion I rather wait with adapting the io package scripts until a
better solution is available.

Perhaps java_get() (and for that matter, java_set()) have been deprecated a
bit overly fast w/o having a working replacement in place. For the other
deprecated functions (java_invoke and java_new) replacement functions were
already there.
At the time we didn't anticipate that we'd have another stable release pending
(= 4.0) while we're already busy with 4.1+

FTR, indeed on Matlab r2012a the dot notation works:

>> org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BOOLEAN

ans =




Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]