1: // Fig. 14.33: MenuOption.java
2: // Defines an enum type for the credit inquiry program's options.
3:
4: public enum MenuOption
5: {
6: // declare contents of enum type
7: PRINT( 1 ),
8: UPDATE( 2 ),
9: NEW( 3 ),
10: DELETE( 4 ),
11: END( 5 );
12:
13: private final int value; // current menu option
14:
15: MenuOption( int valueOption )
16: {
17: value = valueOption;
18: } // end MenuOptions enum constructor
19:
20: public int getValue()
21: {
22: return value;
23: } // end method getValue
24: } // end enum MenuOption
25:
26: /*************************************************************************
27: * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and *
28: * Pearson Education, Inc. All Rights Reserved. *
29: * *
30: * DISCLAIMER: The authors and publisher of this book have used their *
31: * best efforts in preparing the book. These efforts include the *
32: * development, research, and testing of the theories and programs *
33: * to determine their effectiveness. The authors and publisher make *
34: * no warranty of any kind, expressed or implied, with regard to these *
35: * programs or to the documentation contained in these books. The authors *
36: * and publisher shall not be liable in any event for incidental or *
37: * consequential damages in connection with, or arising out of, the *
38: * furnishing, performance, or use of these programs. *
39: *************************************************************************/