|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
digitalmars.D - Java Array --> D Array
I'm not terribly knowledgeable about Java arrays and all the permuatations of
assignment and such. I don't know what to make of the following:
// Java Code
public class Control : Widget , IDrawable {
...
Control [] computeTabList () {
if (isTabGroup ()) {
if (getVisible () && getEnabled ()) {
return new Control [] [this]; // not sure what this is.
}
}
return new Control [0];
}
...
}
The compiler complains about implicitly converting from Control to int, and I
get that the array index should be integers, but what is Java doing with 'this'
in the array index?
My first thought was that this is actually an assignment of the new Control[]
that is done inside of [ ] in Java. So I tried to use D's { }, but alas, it's
not a static array.
Any assistance on how to turn this into D code?
BA
Jul 03 2004
Brad Anderson wrote: Jul 03 2004
Sam McCall wrote:Brad Anderson wrote: Jul 03 2004
Jul 03 2004
Brad Anderson wrote: Jul 03 2004
"Brad Anderson" <brad dsource.dot.org> wrote in message news:cc5opo$2cdr$1 digitaldaemon.com... Jul 03 2004
Walter wrote:"Brad Anderson" <brad dsource.dot.org> wrote in message news:cc5opo$2cdr$1 digitaldaemon.com...I settled on this: Control[] ret; ret[0] = this; return ret; Jul 03 2004
|