title: Emulate C++ enum integer with Java Enums
body: <p>I'm attempting to translate some C++ code into Java.  I'm looking for the best way to emulate this type of C++ paradigm in Java -- I think enums are probably the answer but I'm open to anything</p>
  
  <p>C++ code:</p>
  
  <pre><code>typedef UInt32 Type;
  enum { UNKNOWN, QUIT, SYSTEM, TIMER, LAST }
  ...
  Type newType = UNKNOWN;
  Type nextType = LAST + 1;
  ...
  // "Register" the new type
  newType = nextType;
  nextType++;
  ...
  switch (newType) {
     case UNKNOWN:
     case QUIT:
     ...
     case LAST:
            // Ignore unset or predefined types
     default:
            // Some type other than the predefined.  Do something special
  </code></pre>
  
  <p>Essentially I'm looking for a way to "expand" the values of a Java enumeration.  </p>
  
  <pre><code>enum Type { UNKNOWN, QUIT, SYSTEM, TIMER, LAST } 
  </code></pre>
  
  <p>doesn't quit cut it.  </p>
  
  <p>I like the idea of making a new object for strong typing.  </p>
  
  <p>Again, I'm looking for the best pattern to use here.  I could easily float by with a few public static final int UNKNOWN, etc</p>