public class FastCharBuffer extends Object implements CharSequence, Appendable
char buffer with some additional features.| 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 bytes. |
| 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(CharSequence csq)
Appends character sequence to buffer.
|
FastCharBuffer |
append(CharSequence csq,
int start,
int end)
Appends character sequence to buffer.
|
FastCharBuffer |
append(FastCharBuffer buff)
Appends another fast buffer to this one.
|
FastCharBuffer |
append(String string)
Appends string content to buffer.
|
char[] |
array(int index)
Returns
char inner array chunk at given index. |
char |
charAt(int index)
Returns char at given index.
|
void |
clear()
Resets the buffer content.
|
char |
get(int index)
Returns
char element at given index. |
int |
index()
Returns current index of inner
char array chunk. |
boolean |
isEmpty()
Tests if this buffer has no elements.
|
int |
length()
Returns buffer length, same as
size(). |
int |
offset()
Returns the offset of last used element in current inner array chunk.
|
int |
size()
Returns buffer size.
|
CharSequence |
subSequence(int start,
int end)
Returns sub sequence.
|
char[] |
toArray()
Creates
char array from buffered content. |
char[] |
toArray(int start,
int len)
Creates
char subarray from buffered content. |
String |
toString()
Returns buffer content as a string.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic FastCharBuffer()
char buffer. The buffer capacity is initially
1024 bytes, though its size increases if necessary.public FastCharBuffer(int size)
char buffer, with a buffer capacity of the
specified size, in bytes.size - the initial size.public FastCharBuffer append(char[] array, int off, int len)
char array to buffer.array - the arrayoff - the offlen - the lenpublic FastCharBuffer append(char[] array)
char array to buffer.array - the arraypublic FastCharBuffer append(char element)
char to buffer.append in interface Appendableelement - the elementpublic FastCharBuffer append(FastCharBuffer buff)
buff - the buffpublic int size()
public boolean isEmpty()
public int index()
char array chunk. Represents
the index of last used inner array chunk.public int offset()
public char[] array(int index)
char inner array chunk at given index. May be used
for iterating inner chunks in fast manner.index - the indexpublic void clear()
public char[] toArray()
char array from buffered content.public char[] toArray(int start,
int len)
char subarray from buffered content.start - the startlen - the lenpublic char get(int index)
char element at given index.index - the indexpublic int length()
size().length in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class Objectpublic char charAt(int index)
charAt in interface CharSequenceindex - the indexpublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencestart - the startend - the endpublic FastCharBuffer append(String string)
string - the stringpublic FastCharBuffer append(CharSequence csq)
append in interface Appendablecsq - the csqpublic FastCharBuffer append(CharSequence csq, int start, int end)
append in interface Appendablecsq - the csqstart - the startend - the endCopyright © 2016 utils4j. All Rights Reserved.