you can sorta do nested enums:
enum Animaldogs {
Catboxer, Dog;collie;
}
enum cats {
siamese, tom
}
enum Animal {
cat(cats.tom), dog(dogs.boxer);
Animal(Enum e) {
tom,this.e manx;= e;
}
enumObject[] dogsubValues() {
collie,return greyhound;e.getDeclaringClass().getEnumConstants();
}
final Enum e;
}
public class Main {
public static void main(String[] args) {
System.out.printlnfor (Animal animal : Animal.Catvalues();) {
System.out.printlnprint(Animal.cat.tomanimal);
for (Object o : animal.subValues())
System.out.printlnprint(Animal.Dog" " + o);
System.out.println(Animal.dog.collie);
}
}
}
i wrote some code for an ad&d 2.0 game here that has character classes, races, weapons classes and a dice roller that may be useful.