Top Description Fields Constructors Methods
com.univocity.parsers.common.input

public Class ElasticCharAppender

extends ExpandingCharAppender
Class Inheritance

A character appender that restores its internal buffer size after expanding to accommodate larger contents.
Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
private int
private static final char[]

Constructor Summary

AccessConstructor and Description
public
public
ElasticCharAppender(int defaultLength, String emptyValue)

Method Summary

Modifier and TypeMethod and Description
public String
getAndReset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.getAndReset.

Implements com.univocity.parsers.common.input.CharAppender.getAndReset.

Returns the accumulated value as a String, discarding any trailing whitespace characters identified when using DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)

The internal accumulated value is discarded after invoking this method (as in DefaultCharAppender#reset())

If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be DefaultCharAppender#emptyValue attribute defined in the constructor of this class.

public char[]
getCharsAndReset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.getCharsAndReset.

Implements com.univocity.parsers.common.input.CharAppender.getCharsAndReset.

Returns the accumulated characters, discarding any trailing whitespace characters identified when using DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)

The internal accumulated value is discarded after invoking this method (as in DefaultCharAppender#reset())

If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be character sequence of the DefaultCharAppender#emptyValue attribute defined in the constructor of this class.

public char[]
public String
public void
reset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.reset.

Implements com.univocity.parsers.common.input.CharAppender.reset.

Clears the accumulated value and the whitespace count.
Inherited from com.univocity.parsers.common.input.ExpandingCharAppender:
appendappendappendappendappendIgnoringPaddingappendIgnoringWhitespaceappendIgnoringWhitespaceAndPaddingappendUntilappendUntilappendUntilexpandexpandexpandAndRetryfillprependprependprepend

Field Detail

defaultLengthback to summary
private int defaultLength
EMPTY_CHAR_ARRAYback to summary
private static final char[] EMPTY_CHAR_ARRAY

Constructor Detail

ElasticCharAppenderback to summary
public ElasticCharAppender(String emptyValue)
ElasticCharAppenderback to summary
public ElasticCharAppender(int defaultLength, String emptyValue)

Method Detail

getAndResetback to summary
public String getAndReset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.getAndReset.

Implements com.univocity.parsers.common.input.CharAppender.getAndReset.

Doc from com.univocity.parsers.common.input.DefaultCharAppender.getAndReset.

Returns the accumulated value as a String, discarding any trailing whitespace characters identified when using DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)

The internal accumulated value is discarded after invoking this method (as in DefaultCharAppender#reset())

If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be DefaultCharAppender#emptyValue attribute defined in the constructor of this class.

Returns:String

a String containing the accumulated characters without the trailing white spaces. Or the DefaultCharAppender#emptyValue defined in the constructor of this class.

Annotations
@Override
getCharsAndResetback to summary
public char[] getCharsAndReset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.getCharsAndReset.

Implements com.univocity.parsers.common.input.CharAppender.getCharsAndReset.

Doc from com.univocity.parsers.common.input.DefaultCharAppender.getCharsAndReset.

Returns the accumulated characters, discarding any trailing whitespace characters identified when using DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)

The internal accumulated value is discarded after invoking this method (as in DefaultCharAppender#reset())

If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be character sequence of the DefaultCharAppender#emptyValue attribute defined in the constructor of this class.

Returns:char[]

a character array containing the accumulated characters without the trailing white spaces. Or the characters of the DefaultCharAppender#emptyValue defined in the constructor of this class.

Annotations
@Override
getTrimmedCharsAndResetback to summary
public char[] getTrimmedCharsAndReset()
getTrimmedStringAndResetback to summary
public String getTrimmedStringAndReset()
resetback to summary
public void reset()

Overrides com.univocity.parsers.common.input.DefaultCharAppender.reset.

Implements com.univocity.parsers.common.input.CharAppender.reset.

Doc from com.univocity.parsers.common.input.CharAppender.reset.

Clears the accumulated value and the whitespace count.

Annotations
@Override