package java.lang {
import java.lang.Arguments;
import java.lang.JavaArray;
dynamic public class Short extends Number__ implements Comparable {
  public static var TYPE: java.lang.Class__ = new java.lang.Class__(new Arguments(java.lang.Class__.Class____Ljava_lang_String_2, ["short"]));
  public static const MIN_VALUE: int = int(0x8000);
  public static const MAX_VALUE: int = int(0x7fff);
  public static const SIZE: int = 16;
  private var value: int;
  public static function decode__Ljava_lang_String_2(s: String): Short {
    return new Short(new Arguments(java.lang.Short.Short__S, [int(Number__.__decodeAndValidateInt__Ljava_lang_String_2II(s, -32768, 32767))]));
  }
  public static function hashCode__S(s: int): int {
    return s;
  }
  public static function parseShort__Ljava_lang_String_2(s: String): int {
    return parseShort__Ljava_lang_String_2I(s, 10);
  }
  public static function parseShort__Ljava_lang_String_2I(s: String, radix: int): int {
    return int(Number__.__parseAndValidateInt__Ljava_lang_String_2III(s, radix, -32768, 32767));
  }
  public static function reverseBytes__S(s: int): int {
    return int((((s & 0xff) << 8) | ((s & 0xff00) >> 8)));
  }
  public static function toString__S(b: int): String {
    return Object(String).valueOf__I(b);
  }
  public static function valueOf__S(s: int): Short {
    if (s > -129 && s < 128) {
      var rebase: int = s + 128;
      var result: Short = Short$BoxedValues.access$0()[rebase];
      if (result === null) {
        result = Short$BoxedValues.access$0()[rebase] = new Short(new Arguments(java.lang.Short.Short__S, [s]));
      }
      return result;
    }
    return new Short(new Arguments(java.lang.Short.Short__S, [s]));
  }
  public static function valueOf__Ljava_lang_String_2(s: String): Short {
    return new Short(new Arguments(java.lang.Short.Short__S, [parseShort__Ljava_lang_String_2(s)]));
  }
  public static function valueOf__Ljava_lang_String_2I(s: String, radix: int): Short {
    return new Short(new Arguments(java.lang.Short.Short__S, [parseShort__Ljava_lang_String_2I(s, radix)]));
  }
  public function Short__S(value: int): Object {
    this.value = value;
    return this;
  }
  public function Short__Ljava_lang_String_2(s: String): Object {
    value = Short.parseShort__Ljava_lang_String_2(s);
    return this;
  }
  public override function byteValue__(): int {
    return int(value);
  }
  public function compareTo__Ljava_lang_Short_2(b: Short): int {
    if (value < b.value) {
      return -1;
    } else if (value > b.value) {
      return 1;
    } else {
      return 0;
    }
    return 0;
  }
  public override function doubleValue__(): Number {
    return value;
  }
  public function equals__Ljava_lang_Object_2(o: Object): Boolean {
    return (o is Short) && ((Short(o)).value == value);
  }
  public override function floatValue__(): Number {
    return value;
  }
  public function hashCode__(): int {
    return Short.hashCode__S(value);
  }
  public override function intValue__(): int {
    return value;
  }
  public override function longValue__(): Number {
    return value;
  }
  public override function shortValue__(): int {
    return value;
  }
  public function toString__(): String {
    return Short.toString__S(value);
  }
  public function compareTo__Ljava_lang_Object_2(arg0: Object): int {
    return arg0.compareTo__Ljava_lang_Short_2();
  }
  public function Short(... vargs) {
    var args: Array;
    var id: int;
    if (vargs.length == 1 && vargs[0] is Arguments) {
      args = Arguments(vargs[0]).args;
      id = Arguments(vargs[0]).id;
    } else {
      if (vargs.length == 1 && vargs[0] is int) {
        args = vargs;
        id = 0;
      } else if (vargs.length == 1 && vargs[0] is String) {
        args = vargs;
        id = 1;
      }
    }
    switch (id) {
      case 0:
        var args0: Array = [args[0]];
        break;
      case 1:
        var args1: Array = [args[0]];
        break;
    }
    super();
    switch (id) {
      case 0:
        Short__S(args0[0]);
        break;
      case 1:
        Short__Ljava_lang_String_2(args1[0]);
        break;
    }
  }
  public static const Short__S : int = 0;
  public static const Short__Ljava_lang_String_2 : int = 1;
}
}
