Source of MenuOption.java


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