Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Delphi like sets

Thread view: 
Vojta - 06 Oct 2006 18:15 GMT
Please, how can I create Delphi like sets in Java?

In Delphi I could define set:

TAnimal = (aDog, aCat, aHorse, aSheep);
TAnimals = set of TAnimal;

And then for example:

Animals := [aDog, aCat];
if aDog in Animals then ...

Can I do sometling similar in Java? How?

Thank you a lot! Vojta
Oliver Wong - 06 Oct 2006 19:12 GMT
> Please, how can I create Delphi like sets in Java?
>
[quoted text clipped - 9 lines]
>
> Can I do sometling similar in Java? How?

   I don't know Delphi, and you didn't provide enough examples to guess at
the semantics, but you could probably do what you intend with either Java
1.5's enum, or the Set interface.

   - Oliver
Vojta - 07 Oct 2006 11:51 GMT
Thank you Oliver! EnumSet it the thing I was looking for:)

>> Please, how can I create Delphi like sets in Java?
>>
[quoted text clipped - 15 lines]
>
>    - Oliver


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.