com.fasterxml.jackson.dataformat.csv.impl

## Class TextBuffer

- java.lang.Object
- - com.fasterxml.jackson.dataformat.csv.impl.TextBuffer

-     public final class TextBuffer
      extends Object

  Helper class for efficiently aggregating parsed and decoded textual content

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextBuffer(com.fasterxml.jackson.core.util.BufferRecycler allocator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `String` | `finishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces)`
    `char[]` | `finishCurrentSegment()`
    `char[]` | `getCurrentSegment()`
    `int` | `getCurrentSegmentSize()`
    `char[]` | `getTextBuffer()`
    `int` | `getTextOffset()`
    `boolean` | `hasTextAsCharacters()`
    `boolean` | `looksLikeInt()`
    `void` | `releaseBuffers()`
    `void` | `reset()`
    `void` | `resetWithString(String value)`
    `int` | `size()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TextBuffer

          public TextBuffer(com.fasterxml.jackson.core.util.BufferRecycler allocator)

  - ### Method Detail

    - #### releaseBuffers

          public void releaseBuffers()

    - #### reset

          public void reset()

    - #### resetWithString

          public void resetWithString(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 String contentsAsString()

    - #### contentsAsArray

          public char[] contentsAsArray()

    - #### contentsAsDecimal

          public BigDecimal contentsAsDecimal()
                                       throws NumberFormatException

      Convenience method for converting contents of the buffer into a `BigDecimal`.
      Throws:
        `NumberFormatException`

    - #### contentsAsDouble

          public double contentsAsDouble()
                                  throws NumberFormatException

      Convenience method for converting contents of the buffer into a Double value.
      Throws:
        `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 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-line
        `trimTrailingSpaces` - Whether trailing spaces should be trimmed or not

    - #### finishCurrentSegment

          public char[] finishCurrentSegment()

Copyright © 2017 FasterXML. All rights reserved.