final void insert0 (int index, char ch) { if (0 > index || index > length) { // RI compatible exception type throw new ArrayIndexOutOfBoundsException(index); } move(1, index); chars[index] = ch; length++; }
final void insert0 (int index, char ch) { if (0 > index || index > length) { // RI compatible exception type throw new ArrayIndexOutOfBoundsException(index); } move(1, index); chars[index] = ch; length++; }
final void insert0 (int index, char[] value) { if (0 > index || index > length) { throw new StringIndexOutOfBoundsException(index); } if (value.length != 0) { move(value.length, index); System.arraycopy(value, 0, value, index, value.length); length += value.length; } }
final void insert0 (int index, char[] value) { if (0 > index || index > length) { throw new StringIndexOutOfBoundsException(index); } if (value.length != 0) { move(value.length, index); System.arraycopy(value, 0, value, index, value.length); length += value.length; } }
final void insert0 (int index, String string) { if (0 <= index && index <= length) { if (string == null) { string = "null"; } int min = string.length(); if (min != 0) { move(min, index); string.getChars(0, min, chars, index); length += min; } } else { throw new StringIndexOutOfBoundsException(index); } }
final void insert0 (int index, String string) { if (0 <= index && index <= length) { if (string == null) { string = "null"; } int min = string.length(); if (min != 0) { move(min, index); string.getChars(0, min, chars, index); length += min; } } else { throw new StringIndexOutOfBoundsException(index); } }
final void insert0 (int index, char[] value, int start, int length) { if (0 <= index && index <= length) { // start + length could overflow, start/length maybe MaxInt if (start >= 0 && 0 <= length && length <= value.length - start) { if (length != 0) { move(length, index); System.arraycopy(value, start, chars, index, length); this.length += length; } return; } throw new StringIndexOutOfBoundsException("offset " + start + ", length " + length + ", char[].length " + value.length); } throw new StringIndexOutOfBoundsException(index); }
final void insert0 (int index, char[] value, int start, int length) { if (0 <= index && index <= length) { // start + length could overflow, start/length maybe MaxInt if (start >= 0 && 0 <= length && length <= value.length - start) { if (length != 0) { move(length, index); System.arraycopy(value, start, chars, index, length); this.length += length; } return; } throw new StringIndexOutOfBoundsException("offset " + start + ", length " + length + ", char[].length " + value.length); } throw new StringIndexOutOfBoundsException(index); }
final void replace0 (int start, int end, String string) { if (start >= 0) { if (end > length) { end = length; } if (end > start) { int stringLength = string.length(); int diff = end - start - stringLength; if (diff > 0) { // replacing with fewer characters // index == count case is no-op System.arraycopy(chars, end, chars, start + stringLength, length - end); } else if (diff < 0) { // replacing with more characters...need some room move(-diff, end); } string.getChars(0, stringLength, chars, start); length -= diff; return; } if (start == end) { if (string == null) { throw new NullPointerException(); } insert0(start, string); return; } } throw new StringIndexOutOfBoundsException(); }
final void replace0 (int start, int end, String string) { if (start >= 0) { if (end > length) { end = length; } if (end > start) { int stringLength = string.length(); int diff = end - start - stringLength; if (diff > 0) { // replacing with fewer characters // index == count case is no-op System.arraycopy(chars, end, chars, start + stringLength, length - end); } else if (diff < 0) { // replacing with more characters...need some room move(-diff, end); } string.getChars(0, stringLength, chars, start); length -= diff; return; } if (start == end) { if (string == null) { throw new NullPointerException(); } insert0(start, string); return; } } throw new StringIndexOutOfBoundsException(); }
final void insert0 (int index, char ch) { if (0 > index || index > length) { // RI compatible exception type throw new ArrayIndexOutOfBoundsException(index); } move(1, index); chars[index] = ch; length++; }
final void insert0 (int index, char[] value) { if (0 > index || index > length) { throw new StringIndexOutOfBoundsException(index); } if (value.length != 0) { move(value.length, index); System.arraycopy(value, 0, value, index, value.length); length += value.length; } }
final void insert0 (int index, String string) { if (0 <= index && index <= length) { if (string == null) { string = "null"; } int min = string.length(); if (min != 0) { move(min, index); string.getChars(0, min, chars, index); length += min; } } else { throw new StringIndexOutOfBoundsException(index); } }
final void insert0 (int index, char[] value, int start, int length) { if (0 <= index && index <= length) { // start + length could overflow, start/length maybe MaxInt if (start >= 0 && 0 <= length && length <= value.length - start) { if (length != 0) { move(length, index); System.arraycopy(value, start, chars, index, length); this.length += length; } return; } throw new StringIndexOutOfBoundsException("offset " + start + ", length " + length + ", char[].length " + value.length); } throw new StringIndexOutOfBoundsException(index); }
final void replace0 (int start, int end, String string) { if (start >= 0) { if (end > length) { end = length; } if (end > start) { int stringLength = string.length(); int diff = end - start - stringLength; if (diff > 0) { // replacing with fewer characters // index == count case is no-op System.arraycopy(chars, end, chars, start + stringLength, length - end); } else if (diff < 0) { // replacing with more characters...need some room move(-diff, end); } string.getChars(0, stringLength, chars, start); length -= diff; return; } if (start == end) { if (string == null) { throw new NullPointerException(); } insert0(start, string); return; } } throw new StringIndexOutOfBoundsException(); }