public class FastCharBuffer
extends java.lang.Object
implements java.lang.CharSequence, java.lang.Appendable
char
buffer.Constructor and Description |
---|
FastCharBuffer()
Creates a new
char buffer. |
FastCharBuffer(int size)
Creates a new
char buffer, with a buffer capacity of
the specified size, in chars. |
Modifier and Type | Method and Description |
---|---|
FastCharBuffer |
append(char element)
Appends single
char to buffer. |
FastCharBuffer |
append(char[] array)
Appends
char array to buffer. |
FastCharBuffer |
append(char[] array,
int off,
int len)
Appends
char array to buffer. |
FastCharBuffer |
append(java.lang.CharSequence csq)
Appends character sequence to buffer.
|
FastCharBuffer |
append(java.lang.CharSequence csq,
int start,
int end)
Appends character sequence to buffer.
|
FastCharBuffer |
append(FastCharBuffer buff)
Appends another fast buffer to this one.
|
char |
charAt(int index) |
void |
clear()
Resets the buffer content.
|
char |
get(int index)
Returns
char element at given index. |
boolean |
isEmpty()
Tests if this buffer has no elements.
|
int |
length() |
int |
size()
Returns buffer size.
|
java.lang.CharSequence |
subSequence(int start,
int end) |
char[] |
toArray()
Creates
char array from buffered content. |
char[] |
toArray(int start,
int len)
Creates
char subarray from buffered content. |
java.lang.String |
toString()
Returns a String of the char buffer.
|
public FastCharBuffer()
char
buffer. The buffer capacity is
initially 64 chars, though its size increases if necessary.public FastCharBuffer(int size)
char
buffer, with a buffer capacity of
the specified size, in chars.size
- the initial size.java.lang.IllegalArgumentException
- if size is negative.public FastCharBuffer append(char element)
char
to buffer.append
in interface java.lang.Appendable
public FastCharBuffer append(char[] array, int off, int len)
char
array to buffer.public FastCharBuffer append(char[] array)
char
array to buffer.public FastCharBuffer append(FastCharBuffer buff)
public int size()
public int length()
length
in interface java.lang.CharSequence
public boolean isEmpty()
public void clear()
public char[] toArray()
char
array from buffered content.public char[] toArray(int start, int len)
char
subarray from buffered content.public char get(int index)
char
element at given index.public FastCharBuffer append(java.lang.CharSequence csq)
append
in interface java.lang.Appendable
public FastCharBuffer append(java.lang.CharSequence csq, int start, int end)
append
in interface java.lang.Appendable
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public java.lang.String toString()
StringBuilder
instead, it is faster.toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
Copyright © 2003-present Jodd Team