add classes and methods needed for GNU Classpath compatibility

Most of these methods are stubs which throw
UnsupportedOperationExceptions for now.
This commit is contained in:
Joel Dice
2009-06-02 17:14:38 -06:00
parent 70bd2d908f
commit 0615b8a09f
18 changed files with 416 additions and 17 deletions

View File

@ -10,7 +10,7 @@
package java.lang;
public class StringBuilder implements CharSequence {
public class StringBuilder implements CharSequence, Appendable {
private static final int BufferSize = 32;
private Cell chain;
@ -54,6 +54,14 @@ public class StringBuilder implements CharSequence {
}
}
public StringBuilder append(CharSequence sequence) {
return append(sequence.toString());
}
public Appendable append(CharSequence sequence, int start, int end) {
return append(sequence.subSequence(start, end));
}
public StringBuilder append(char[] b, int offset, int length) {
return append(new String(b, offset, length));
}
@ -150,6 +158,10 @@ public class StringBuilder implements CharSequence {
return this;
}
public StringBuilder insert(int i, CharSequence s) {
return insert(i, s.toString());
}
public StringBuilder insert(int i, char c) {
return insert(i, new String(new char[] { c }, 0, 1, false));
}
@ -332,4 +344,8 @@ public class StringBuilder implements CharSequence {
deleteCharAt(index);
insert(index, ch);
}
public void ensureCapacity(int capacity) {
// ignore
}
}