Ejemplo n.º 1
0
 static {
   TreeMap<Integer, Status> canonicalizer = new TreeMap<Integer, Status>();
   for (Code code : Code.values()) {
     Status replaced = canonicalizer.put(code.value(), new Status(code));
     if (replaced != null) {
       throw new IllegalStateException(
           "Code value duplication between " + replaced.getCode().name() + " & " + code.name());
     }
   }
   STATUS_LIST = new ArrayList<Status>(canonicalizer.values());
 }
Ejemplo n.º 2
0
 private final void initKeywords() {
   for (int i = Code.FIRST_KW.ordinal(); i <= Code.LAST_KW.ordinal(); ++i) {
     final Code c = Code.values()[i];
     m_symTab.symbol(c.str).keyword = c;
   }
 }