Java enum in JPL
Jerry <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAEpPntgyzvry5S3Sp-D1kc_PPLTgYvFBEvSPUg1ZLWkZLCfKiw@mail.gmail.com> |
All,
I have been researching the web to find out how to create enum variables in
JPL. So far I have found now examples and trial and error has been mostly
error. Here is the fragment I need to emulate from SWI Prolog:
ArrayList< String > namesOfInterest = new ArrayList< String >();
AppTierSourceUsageRequestMessage.MessageType messageType =
getInvokeArgs( args, namesOfInterest );
ArrayList< String > result = null;
try {
result = invoke( messageType, namesOfInterest );
}
catch( CannotProcessException ex ) {
System.out.println( "MakeAppTierRequest.invoke() failed! Got ex=" +
ex );
System.exit( 1 );
}
MessageType is an enum. I know how to make an array of strings as needed
for the 2nd argument of invoke but not so much luck with the first
argument. I want to pass the constant enum value:
GET_FILE_NAMES_AND_TOKEN_NAMES.
My call so far looks like:
jpl_call( 'com.xxxxxx.xxxxx.messages.MakeAppTierRequest', invoke,
['????',Ac], F),
Ac is an array of Strings and seems to be correct.
Any thoughts or example uses of enum variables in JPL would be appreciated!
Thanks!
Jerry
-------------- next part --------------
HTML attachment scrubbed and removed