Class TextBuffer
- java.lang.Object
-
- com.fasterxml.jackson.dataformat.csv.impl.TextBuffer
-
public final class TextBuffer extends java.lang.ObjectHelper class for efficiently aggregating parsed and decoded textual content
-
-
Constructor Summary
Constructors Constructor Description TextBuffer(com.fasterxml.jackson.core.util.BufferRecycler allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char[]contentsAsArray()java.math.BigDecimalcontentsAsDecimal()Convenience method for converting contents of the buffer into aBigDecimal.doublecontentsAsDouble()Convenience method for converting contents of the buffer into a Double value.java.lang.StringcontentsAsString()char[]emptyAndGetCurrentSegment()voidensureNotShared()Method called to make sure that buffer is not using shared input buffer; if it is, it will copy such contents to private buffer.java.lang.StringfinishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces)char[]finishCurrentSegment()char[]getCurrentSegment()intgetCurrentSegmentSize()char[]getTextBuffer()intgetTextOffset()booleanhasTextAsCharacters()booleanlooksLikeInt()voidreleaseBuffers()voidreset()voidresetWithString(java.lang.String value)intsize()
-
-
-
Method Detail
-
releaseBuffers
public void releaseBuffers()
-
reset
public void reset()
-
resetWithString
public void resetWithString(java.lang.String value)
-
size
public int size()
- Returns:
- Number of characters currently stored by this collector
-
getTextOffset
public int getTextOffset()
-
hasTextAsCharacters
public boolean hasTextAsCharacters()
-
getTextBuffer
public char[] getTextBuffer()
-
contentsAsString
public java.lang.String contentsAsString()
-
contentsAsArray
public char[] contentsAsArray()
-
contentsAsDecimal
public java.math.BigDecimal contentsAsDecimal() throws java.lang.NumberFormatExceptionConvenience method for converting contents of the buffer into aBigDecimal.- Throws:
java.lang.NumberFormatException
-
contentsAsDouble
public double contentsAsDouble() throws java.lang.NumberFormatExceptionConvenience method for converting contents of the buffer into a Double value.- Throws:
java.lang.NumberFormatException
-
looksLikeInt
public boolean looksLikeInt()
-
ensureNotShared
public 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.
-
getCurrentSegment
public char[] getCurrentSegment()
-
emptyAndGetCurrentSegment
public final char[] emptyAndGetCurrentSegment()
-
getCurrentSegmentSize
public int getCurrentSegmentSize()
-
finishAndReturn
public java.lang.String finishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces)- Parameters:
lastSegmentEnd- End offset in the currently active segment, could be 0 in the case of first character is delimiter or end-of-linetrimTrailingSpaces- Whether trailing spaces should be trimmed or not
-
finishCurrentSegment
public char[] finishCurrentSegment()
-
-