|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.core.util.TextBuffer
public final class TextBuffer
TextBuffer is a class similar to StringBuffer
, with
following differences:
Constructor Summary | |
---|---|
TextBuffer(BufferRecycler allocator)
|
Method Summary | |
---|---|
void |
append(char c)
|
void |
append(char[] c,
int start,
int len)
|
void |
append(String str,
int offset,
int len)
|
char[] |
contentsAsArray()
|
BigDecimal |
contentsAsDecimal()
Convenience method for converting contents of the buffer into a BigDecimal . |
double |
contentsAsDouble()
Convenience method for converting contents of the buffer into a Double value. |
String |
contentsAsString()
|
char[] |
emptyAndGetCurrentSegment()
|
void |
ensureNotShared()
Method called to make sure that buffer is not using shared input buffer; if it is, it will copy such contents to private buffer. |
char[] |
expandCurrentSegment()
Method called to expand size of the current segment, to accomodate for more contiguous content. |
char[] |
finishCurrentSegment()
|
char[] |
getCurrentSegment()
|
int |
getCurrentSegmentSize()
|
char[] |
getTextBuffer()
|
int |
getTextOffset()
|
boolean |
hasTextAsCharacters()
Method that can be used to check whether textual contents can be efficiently accessed using getTextBuffer() . |
void |
releaseBuffers()
Method called to indicate that the underlying buffers should now be recycled if they haven't yet been recycled. |
void |
resetWithCopy(char[] buf,
int start,
int len)
|
void |
resetWithEmpty()
Method called to clear out any content text buffer may have, and initializes buffer to use non-shared data. |
void |
resetWithShared(char[] buf,
int start,
int len)
Method called to initialize the buffer with a shared copy of data; this means that buffer will just have pointers to actual data. |
void |
resetWithString(String value)
|
void |
setCurrentLength(int len)
|
int |
size()
|
String |
toString()
Note: calling this method may not be as efficient as calling contentsAsString() , since it's not guaranteed that resulting
String is cached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextBuffer(BufferRecycler allocator)
Method Detail |
---|
public void releaseBuffers()
public void resetWithEmpty()
public void resetWithShared(char[] buf, int start, int len)
public void resetWithCopy(char[] buf, int start, int len)
public void resetWithString(String value)
public int size()
public int getTextOffset()
public boolean hasTextAsCharacters()
getTextBuffer()
.
public char[] getTextBuffer()
public String contentsAsString()
public char[] contentsAsArray()
public BigDecimal contentsAsDecimal() throws NumberFormatException
BigDecimal
.
NumberFormatException
public double contentsAsDouble() throws NumberFormatException
NumberFormatException
public void ensureNotShared()
public void append(char c)
public void append(char[] c, int start, int len)
public void append(String str, int offset, int len)
public char[] getCurrentSegment()
public final char[] emptyAndGetCurrentSegment()
public int getCurrentSegmentSize()
public void setCurrentLength(int len)
public char[] finishCurrentSegment()
public char[] expandCurrentSegment()
public String toString()
contentsAsString()
, since it's not guaranteed that resulting
String is cached.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |