mirror of
https://github.com/corda/corda.git
synced 2025-01-24 05:18:24 +00:00
added StringBuffer/Builder methods
This commit is contained in:
parent
96c6c7f8ea
commit
8e79618392
@ -75,6 +75,14 @@ public class StringBuffer implements CharSequence {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized int indexOf(String s) {
|
||||||
|
return sb.indexOf(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized int indexOf(String s, int fromIndex) {
|
||||||
|
return sb.indexOf(s, fromIndex);
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized StringBuffer insert(int i, String s) {
|
public synchronized StringBuffer insert(int i, String s) {
|
||||||
sb.insert(i, s);
|
sb.insert(i, s);
|
||||||
return this;
|
return this;
|
||||||
@ -112,6 +120,10 @@ public class StringBuffer implements CharSequence {
|
|||||||
sb.setLength(v);
|
sb.setLength(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized void setCharAt(int index, char ch) {
|
||||||
|
sb.setCharAt(index, ch);
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void getChars(int srcOffset, int srcLength, char[] dst,
|
public synchronized void getChars(int srcOffset, int srcLength, char[] dst,
|
||||||
int dstOffset)
|
int dstOffset)
|
||||||
{
|
{
|
||||||
|
@ -322,4 +322,10 @@ public class StringBuilder implements CharSequence {
|
|||||||
public CharSequence subSequence(int start, int end) {
|
public CharSequence subSequence(int start, int end) {
|
||||||
return substring(start, end);
|
return substring(start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCharAt(int index, char ch) {
|
||||||
|
if(index < 0 || index >= length) throw new IndexOutOfBoundsException();
|
||||||
|
deleteCharAt(index);
|
||||||
|
insert(index, ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user