package java.lang {
import com.google.gwt.core.client.JavaScriptObject;
import java.io.Serializable;
import java.util.Iterator;
import java.lang.Arguments;
import java.lang.Class__;
import java.lang.JavaArray;
dynamic public class Enum implements Comparable, Serializable {
  private var name: String;
  private var ordinal: int;
  public static function valueOf__Ljava_lang_Class_2Ljava_lang_String_2(enumType: Class__, name: String): java.lang.Enum {
    if (enumType === null || name === null) {
      throw new NullPointerException(new Arguments(java.lang.NullPointerException.NullPointerException__Ljava_lang_String_2, ["enumType and name must not be null."]));
    }
    var constants: JavaArray = enumType.getEnumConstants__();
    if (constants === null) {
      throw new IllegalArgumentException(new Arguments(java.lang.IllegalArgumentException.IllegalArgumentException__Ljava_lang_String_2, [enumType.getName__() + " is not an enum."]));
    }
    for (var i: int = 0; i < constants.length; i++) {
      if (Object(constants[i].name__()).equals__Ljava_lang_Object_2(name))
        return constants[i];
    }
    throw new IllegalArgumentException(new Arguments(java.lang.IllegalArgumentException.IllegalArgumentException__Ljava_lang_String_2, [enumType.getName__() + " does not have an enum constant named, " + name + "."]));
    return null;
  }
  public static function valueOf__Lcom_google_gwt_core_client_JavaScriptObject_2Ljava_lang_String_2(map: Object, name: String): java.lang.Enum {
    var result: java.lang.Enum = java.lang.Enum(java.lang.Enum.valueOf0__Lcom_google_gwt_core_client_JavaScriptObject_2Ljava_lang_String_2(map, "_" + name));
    if (result === null) {
      throw new IllegalArgumentException(new Arguments(java.lang.IllegalArgumentException.IllegalArgumentException__Ljava_lang_String_2, [name]));
    }
    return result;
  }
  private static function valueOf0__Lcom_google_gwt_core_client_JavaScriptObject_2Ljava_lang_String_2(map: Object, name: String): java.lang.Enum {
    return map[name];
  }
  public function Enum(name: String, ordinal: int) {
    this.name = name;
    this.ordinal = ordinal;
    return;
  }
  public function compareTo__Ljava_lang_Enum_2(other: Enum): int {
    return this.ordinal - other.ordinal;
  }
  public function equals__Ljava_lang_Object_2(other: Object): Boolean {
    return this === other;
  }
  public function getDeclaringClass__(): Class__ {
    var clazz: java.lang.Class__ = Object(this).getClass__();
    var superclass: java.lang.Class__ = clazz.getSuperclass__();
    return (superclass === Class__.forName__Ljava_lang_String_2("java.lang.Enum")) ? clazz : superclass;
  }
  public function hashCode__(): int {
    return Object(Object.prototype).hashCode__.call(this);
  }
  public function name__(): String {
    return name;
  }
  public function ordinal__(): int {
    return ordinal;
  }
  public function toString__(): String {
    return name;
  }
  public function compareTo__Ljava_lang_Object_2(arg0: Object): int {
    return arg0.compareTo__Ljava_lang_Enum_2();
  }
}
}
