package java.lang {
import java.lang.Arguments;
import java.lang.JavaArray;
dynamic public class StringBuffer implements CharSequence {
  private var builder: StringBuilder = new StringBuilder(new Arguments(java.lang.StringBuilder.StringBuilder__, []));
  public function StringBuffer__(): Object {
    return this;
  }
  public function StringBuffer__Ljava_lang_CharSequence_2(s: CharSequence): Object {
    return this;
  }
  public function StringBuffer__I(ignoredCapacity: int): Object {
    return this;
  }
  public function StringBuffer__Ljava_lang_String_2(s: String): Object {
    this.append__Ljava_lang_String_2(s);
    return this;
  }
  public function append__Z(x: Boolean): StringBuffer {
    builder.append__Z(x);
    return this;
  }
  public function append__C(x: uint): StringBuffer {
    builder.append__C(x);
    return this;
  }
  public function append___3C(x: JavaArray): StringBuffer {
    builder.append___3C(x);
    return this;
  }
  public function append___3CII(x: JavaArray, start: int, len: int): StringBuffer {
    builder.append___3CII(x, start, len);
    return this;
  }
  public function append__Ljava_lang_CharSequence_2(x: CharSequence): StringBuffer {
    builder.append__Ljava_lang_CharSequence_2(x);
    return this;
  }
  public function append__Ljava_lang_CharSequence_2II(x: CharSequence, start: int, end: int): StringBuffer {
    builder.append__Ljava_lang_CharSequence_2II(x, start, end);
    return this;
  }
  public function append__D(x: Number): StringBuffer {
    builder.append__D(x);
    return this;
  }
  public function append__F(x: Number): StringBuffer {
    builder.append__F(x);
    return this;
  }
  public function append__I(x: int): StringBuffer {
    builder.append__I(x);
    return this;
  }
  public function append__J(x: Number): StringBuffer {
    builder.append__J(x);
    return this;
  }
  public function append__Ljava_lang_Object_2(x: Object): StringBuffer {
    builder.append__Ljava_lang_Object_2(x);
    return this;
  }
  public function append__Ljava_lang_String_2(toAppend: String): StringBuffer {
    builder.append__Ljava_lang_String_2(toAppend);
    return this;
  }
  public function append__Ljava_lang_StringBuffer_2(x: StringBuffer): StringBuffer {
    builder.append__Ljava_lang_StringBuffer_2(x);
    return this;
  }
  public function capacity__(): int {
    return builder.capacity__();
  }
  public function charAt__I(index: int): uint {
    return builder.charAt__I(index);
  }
  public function delete__II(start: int, end: int): StringBuffer {
    builder.delete__II(start, end);
    return this;
  }
  public function deleteCharAt__I(start: int): StringBuffer {
    builder.deleteCharAt__I(start);
    return this;
  }
  public function ensureCapacity__I(ignoredCapacity: int): void {
    builder.ensureCapacity__I(ignoredCapacity);
  }
  public function getChars__II_3CI(srcStart: int, srcEnd: int, dst: JavaArray, dstStart: int): void {
    builder.getChars__II_3CI(srcStart, srcEnd, dst, dstStart);
  }
  public function indexOf__Ljava_lang_String_2(x: String): int {
    return builder.indexOf__Ljava_lang_String_2(x);
  }
  public function indexOf__Ljava_lang_String_2I(x: String, start: int): int {
    return builder.indexOf__Ljava_lang_String_2I(x, start);
  }
  public function insert__IZ(index: int, x: Boolean): StringBuffer {
    builder.insert__IZ(index, x);
    return this;
  }
  public function insert__IC(index: int, x: uint): StringBuffer {
    builder.insert__IC(index, x);
    return this;
  }
  public function insert__I_3C(index: int, x: JavaArray): StringBuffer {
    builder.insert__I_3C(index, x);
    return this;
  }
  public function insert__I_3CII(index: int, x: JavaArray, offset: int, len: int): StringBuffer {
    builder.insert__I_3CII(index, x, offset, len);
    return this;
  }
  public function insert__ILjava_lang_CharSequence_2(index: int, chars: CharSequence): StringBuffer {
    builder.insert__ILjava_lang_CharSequence_2(index, chars);
    return this;
  }
  public function insert__ILjava_lang_CharSequence_2II(index: int, chars: CharSequence, start: int, end: int): StringBuffer {
    builder.insert__ILjava_lang_CharSequence_2II(index, chars, start, end);
    return this;
  }
  public function insert__ID(index: int, x: Number): StringBuffer {
    builder.insert__ID(index, x);
    return this;
  }
  public function insert__IF(index: int, x: Number): StringBuffer {
    builder.insert__IF(index, x);
    return this;
  }
  public function insert__II(index: int, x: int): StringBuffer {
    builder.insert__II(index, x);
    return this;
  }
  public function insert__IJ(index: int, x: Number): StringBuffer {
    builder.insert__IJ(index, x);
    return this;
  }
  public function insert__ILjava_lang_Object_2(index: int, x: Object): StringBuffer {
    builder.insert__ILjava_lang_Object_2(index, x);
    return this;
  }
  public function insert__ILjava_lang_String_2(index: int, x: String): StringBuffer {
    builder.insert__ILjava_lang_String_2(index, x);
    return this;
  }
  public function lastIndexOf__Ljava_lang_String_2(s: String): int {
    return builder.lastIndexOf__Ljava_lang_String_2(s);
  }
  public function lastIndexOf__Ljava_lang_String_2I(s: String, start: int): int {
    return builder.lastIndexOf__Ljava_lang_String_2I(s, start);
  }
  public function length__(): int {
    return builder.length__();
  }
  public function replace__IILjava_lang_String_2(start: int, end: int, toInsert: String): StringBuffer {
    builder.replace__IILjava_lang_String_2(start, end, toInsert);
    return this;
  }
  public function setCharAt__IC(index: int, x: uint): void {
    builder.setCharAt__IC(index, x);
  }
  public function setLength__I(newLength: int): void {
    builder.setLength__I(newLength);
  }
  public function subSequence__II(start: int, end: int): CharSequence {
    return builder.subSequence__II(start, end);
  }
  public function substring__I(begin: int): String {
    return builder.substring__I(begin);
  }
  public function substring__II(begin: int, end: int): String {
    return builder.substring__II(begin, end);
  }
  public function toString__(): String {
    return builder.toString__();
  }
  public function trimToSize__(): void {
    builder.trimToSize__();
  }
  public function StringBuffer(... 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 == 0) {
        id = 0;
      } else if (vargs.length == 1 && vargs[0] is CharSequence) {
        args = vargs;
        id = 1;
      } else if (vargs.length == 1 && vargs[0] is int) {
        args = vargs;
        id = 2;
      } else if (vargs.length == 1 && vargs[0] is String) {
        args = vargs;
        id = 3;
      }
    }
    switch (id) {
      case 0:
        break;
      case 1:
        var args1: Array = [args[0]];
        args3 = [Object(args1[0]).toString__()];
        break;
      case 2:
        var args2: Array = [args[0]];
        break;
      case 3:
        var args3: Array = [args[0]];
        break;
    }
    super();
    switch (id) {
      case 0:
        StringBuffer__();
        break;
      case 1:
        StringBuffer__Ljava_lang_String_2(args3[0]);
        StringBuffer__Ljava_lang_CharSequence_2(args1[0]);
        break;
      case 2:
        StringBuffer__I(args2[0]);
        break;
      case 3:
        StringBuffer__Ljava_lang_String_2(args3[0]);
        break;
    }
  }
  public static const StringBuffer__ : int = 0;
  public static const StringBuffer__Ljava_lang_CharSequence_2 : int = 1;
  public static const StringBuffer__I : int = 2;
  public static const StringBuffer__Ljava_lang_String_2 : int = 3;
}
}
