title: How to map enums to integers
body: <p>I have an enum class</p>
  
  <pre><code>public enum PacketTypes {
          NONE,  //0
          TEXT, //1
          ACCEL, //2
          GYRO,  //3
          MAG,   //4
          LOCATION, //5
          QUAT, //6
          COLOR, //7
          BUTTON //8
      }
  </code></pre>
  
  <p>I'm curious how to map these enums to ints, e.g.</p>
  
  <pre><code>    System.out.println(PacketTypes.LOCATION); // Prints a 5
  </code></pre>
  
  <p>I hope that makes sense. </p>