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