public class ElasticCharAppender extends ExpandingCharAppender
Constructor and Description |
---|
ElasticCharAppender(int defaultLength,
String emptyValue) |
ElasticCharAppender(String emptyValue) |
Modifier and Type | Method and Description |
---|---|
String |
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) |
char[] |
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) |
char[] |
getTrimmedCharsAndReset() |
String |
getTrimmedStringAndReset() |
void |
reset()
Clears the accumulated value and the whitespace count.
|
append, append, append, append, appendIgnoringPadding, appendIgnoringWhitespace, appendIgnoringWhitespaceAndPadding, appendUntil, appendUntil, appendUntil, fill, prepend, prepend, prepend
append, append, append, append, append, charAt, delete, getChars, ignore, indexOf, indexOf, indexOf, indexOfAny, isEmpty, lastIndexOf, length, remove, resetWhitespaceCount, subSequence, substring, toString, updateWhitespace, whitespaceCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public ElasticCharAppender(String emptyValue)
public ElasticCharAppender(int defaultLength, String emptyValue)
public String getAndReset()
DefaultCharAppender
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.
getAndReset
in interface CharAppender
getAndReset
in class DefaultCharAppender
DefaultCharAppender.emptyValue
defined in the constructor of this class.public char[] getCharsAndReset()
DefaultCharAppender
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.
getCharsAndReset
in interface CharAppender
getCharsAndReset
in class DefaultCharAppender
DefaultCharAppender.emptyValue
defined in the constructor of this class.public void reset()
CharAppender
reset
in interface CharAppender
reset
in class DefaultCharAppender
public String getTrimmedStringAndReset()
public char[] getTrimmedCharsAndReset()
Copyright © 2023 Univocity Software Pty Ltd. All rights reserved.