12 messages in net.java.dev.jna.usersRe: [jna-users] Re: equivalant of enu...
FromSent OnAttachments
daniel jeemNov 10, 2008 12:00 am 
daniel jeemNov 10, 2008 1:33 am 
Stephen ConnollyNov 10, 2008 2:38 am 
daniel jeemNov 10, 2008 3:30 am 
daniel jeemNov 10, 2008 7:35 am 
Stefan EndrullisNov 10, 2008 8:09 am 
LYou...@gkservices.comNov 10, 2008 9:07 am 
daniel jeemNov 11, 2008 12:54 am 
daniel jeemNov 12, 2008 12:28 am 
Stefan EndrullisNov 12, 2008 2:26 am 
daniel jeemNov 12, 2008 5:08 am 
LYou...@gkservices.comNov 12, 2008 2:37 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: equivalant of enumerations in JNAActions...
From:Stefan Endrullis (ste@endrullis.de)
Date:Nov 10, 2008 8:09:51 am
List:net.java.dev.jna.users

I don't know if JNA is also able to map enums.

Thus I would define constants for the enum values. It's easy and implemented very fast: public static final int sunday = 0;

But if you are searching for an perfect solution with a typed parameter, you could spend more time in studying NativeMapped. You can find an example of a NativeMapped class in the examples.jar. There is a class called X11 which contains a subclass "Atom". And this class extends NativeMapped. Within the class there are lots of constants defined. Now you could also define a class like Atom for your enumeration. But it's much more difficult then simple define int constants. That's why I would suggest you the fist solution.

Regards, Stefan

daniel jeem schrieb:

Please, I also want to call my methode with a value of DAY, I don't want call like this: example (0); But: example (sunday); How can I do this. Help please. Thanks in advance.