StringCharBufferpublic class StringCharBuffer extends CharBuffer
Fields Summary |
---|
CharSequence | str |
Constructors Summary |
---|
StringCharBuffer(CharSequence s, int start, int end) // package-private
super(-1, start, end, s.length());
int n = s.length();
if ((start < 0) || (start > n) || (end < start) || (end > n))
throw new IndexOutOfBoundsException();
str = s;
| private StringCharBuffer(CharSequence s, int mark, int pos, int limit, int cap, int offset)
super(mark, pos, limit, cap, null, offset);
str = s;
| private StringCharBuffer(CharSequence s, int mark, int pos, int limit, int cap)
super(mark, pos, limit, cap);
str = s;
|
Methods Summary |
---|
public java.nio.CharBuffer | asReadOnlyBuffer()
return duplicate();
| public final java.nio.CharBuffer | compact()
throw new ReadOnlyBufferException();
| public java.nio.CharBuffer | duplicate()
return new StringCharBuffer(str, markValue(),
position(), limit(), capacity());
| public final char | get()
return str.charAt(nextGetIndex());
| public final char | get(int index)
return str.charAt(checkIndex(index));
| public boolean | isDirect()
return false;
| public final boolean | isReadOnly()
return true;
| public java.nio.ByteOrder | order()
return ByteOrder.nativeOrder();
| public final java.nio.CharBuffer | put(int index, char c)
throw new ReadOnlyBufferException();
| public final java.nio.CharBuffer | put(char c)
throw new ReadOnlyBufferException();
| public java.nio.CharBuffer | slice()
return new StringCharBuffer(str,
-1,
0,
this.remaining(),
this.remaining(),
this.position());
| public final java.lang.CharSequence | subSequence(int start, int end)
try {
int pos = position();
return new StringCharBuffer(str,
pos + checkIndex(start, pos),
pos + checkIndex(end, pos));
} catch (IllegalArgumentException x) {
throw new IndexOutOfBoundsException();
}
| final java.lang.String | toString(int start, int end)
return str.toString().substring(start, end);
|
|