public enum TagEnum {
MALE,FEMALE,//GENDER
YOUNG,MIDDLE_AGED,OLD//AGE
}
I wanna use TagEnum to describe a Person. MALE and FEMALE are mutually exclusive, so are those enums for age.
For example, once you put MALE into the EnumSet, FEMALE will not be accepted.
Is there such a EnumSet?
==update==
Note that both of gender and age are used to describe a person. What's going on if I have more then 5 dimensions? To make 5 enums and 5 separate references?
Since I need a test method to know if someone own such an enum, it's redundant to make 5 overloaded methods like this:
boolean test(Age age);
boolean test(Gender gender);
boolean test(OtherDimension other);
//What a pity Enum can't be inherited
Is there a way to make it easier? Thanks!