2015-04-20 15:36:01 -07:00
|
|
|
|
//: enumerated/menu/Course.java
|
2015-05-29 14:18:51 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
2015-04-20 15:36:01 -07:00
|
|
|
|
package enumerated.menu;
|
|
|
|
|
import net.mindview.util.*;
|
|
|
|
|
|
|
|
|
|
public enum Course {
|
|
|
|
|
APPETIZER(Food.Appetizer.class),
|
|
|
|
|
MAINCOURSE(Food.MainCourse.class),
|
|
|
|
|
DESSERT(Food.Dessert.class),
|
|
|
|
|
COFFEE(Food.Coffee.class);
|
|
|
|
|
private Food[] values;
|
|
|
|
|
private Course(Class<? extends Food> kind) {
|
|
|
|
|
values = kind.getEnumConstants();
|
|
|
|
|
}
|
|
|
|
|
public Food randomSelection() {
|
|
|
|
|
return Enums.random(values);
|
|
|
|
|
}
|
|
|
|
|
} ///:~
|