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

public Class DefaultCharAppender

extends Object
implements CharAppender
Class Inheritance
All Implemented Interfaces
com.univocity.parsers.common.input.CharAppender, java.lang.CharSequence
Known Direct Subclasses
com.univocity.parsers.common.input.ExpandingCharAppender

Default implementation of the CharAppender interface

Field Summary

Modifier and TypeField and Description
pack-priv char[]
pack-priv final char[]
pack-priv final String
pack-priv int
pack-priv int
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
DefaultCharAppender(int
maximum limit of characters to append
maxLength
,
String
default value to return when no characters have been accumulated
emptyValue
,
int
starting range of characters considered to be whitespace.
whitespaceRangeStart
)

Creates a DefaultCharAppender with a maximum limit of characters to append and the default value to return when no characters have been accumulated.

Method Summary

Modifier and TypeMethod and Description
public void
append(char
the character to append
ch
)

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

Appends the given character.
public final void
append(Object
the object whose String representation will be appended.
o
)

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

Appends the String representation of a given object.
public final void
append(int
the codepoint to append
ch
)

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

Appends the given codepoint.
public final void
append(int[]
the codepoint array
ch
)

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

Appends codepoints from an input array
public void
append(DefaultCharAppender
The DefaultCharAppender instance got get contents from.
appender
)

Appends the contents of another DefaultCharAppender, discarding any of its trailing whitespace characters

public void
append(char[]
the character array
ch
,
int
the position of the first character in the array to be appended
from
,
int
the number of characters to be appended from the given posiion.
length
)

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

Appends characters from an input array
public final void
append(char[]
the character array
ch
)

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

Appends characters from an input array
public void
append(String
the string whose characters will be appended.
string
,
int
the index of the first character to append
from
,
int
the index of the last character to append
to
)

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

Appends the contents of a String to this appender
public final void
append(String
the input String
string
)

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

Appends characters from an input String
public void
appendIgnoringPadding(char
character to append
ch
,
char
the padding character to ignore
padding
)

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

Appends the given character and marks it as ignored if it is a padding character (the definition of a padding character is implementation dependent.)
public void
appendIgnoringWhitespace(char
character to append
ch
)

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

Appends the given character and marks it as ignored if it is a whitespace (ch <= ' ')
public void
appendIgnoringWhitespaceAndPadding(char
character to append
ch
,
char
the padding character to ignore
padding
)

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

Appends the given character and marks it as ignored if it is a whitespace (ch <= ' ') or a padding character (the definition of a padding character is implementation dependent.)
public char
appendUntil(char
the first character of the input to be appended.
ch
,
CharInput
the input whose the following characters will be appended
input
,
char
the stop character
stop
)

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

Appends characters from the input, until a stop character is found
public char
appendUntil(char
the first character of the input to be appended.
ch
,
CharInput
the input whose the following characters will be appended
input
,
char
the first stop character
stop1
,
char
the second stop character
stop2
)

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

Appends characters from the input, until a stop character is found
public char
appendUntil(char
the first character of the input to be appended.
ch
,
CharInput
the input whose the following characters will be appended
input
,
char
the first stop character
stop1
,
char
the second stop character
stop2
,
char
the third stop character
stop3
)

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

Appends characters from the input, until a stop character is found
public final char
charAt(int
the index of the char value to be returned
i
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.
public void
delete(int
the number of characters to delete.
count
)

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

Deletes a given number of characters from the end of the appended content.
public void
fill(char
the character to append
ch
,
int
the number of times the given character should be appended.
length
)

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

Adds a sequence of repeated characters to the input.
public String

Returns:

a String containing the accumulated characters without the trailing white spaces. Or the DefaultCharAppender#emptyValue defined in the constructor of this class.
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 final char[]
getChars()

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

Returns the internal character array.
public char[]

Returns:

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.
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 final void
ignore(int
the number of characters to ignore
count
)

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

Ignores the given number of characters at the end of the appended content, effectively marking these as whitespace.
public int
indexOf(char
the character to look for
ch
,
int
the starting index from where the search will begin.
from
)

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

Returns first the position of a given character
public int
indexOf(char[]
the character sequence to look for
charSequence
,
int
the starting index from where the search will begin.
fromIndex
)

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

Returns first the position of a given character sequence
public int
indexOf(CharSequence
the character sequence to look for
charSequence
,
int
the starting index from where the search will begin.
fromIndex
)

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

Returns first the position of a given character sequence
public int
indexOfAny(char[]
the characters to look for
chars
,
int
the starting index from where the search will begin.
from
)

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

Returns the first position of any given character
public boolean
isEmpty()

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

Indicates whether this appender represents an empty String.
public int
lastIndexOf(char
the character to look for
ch
)

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

Returns the last index of a given character in the current appended (characters that have been marked as whitespace will be ignored)
public final int
length()

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

Returns the current accumulated value length (the sum of all appended characters - whitespaceCount).
public void
prepend(char
the character to prepend in front of the current accumulated value.
ch
)

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

Prepends the current accumulated value with a character
public void
prepend(char
the first character to prepend in front of the current accumulated value.
ch1
,
char
the second character to prepend in front of the current accumulated value.
ch2
)

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

Prepends the current accumulated value with a couple of characters
public void
prepend(char[]
the character sequence to prepend in front of the current accumulated value.
chars
)

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

Prepends the current accumulated value a sequence of characters
public void
remove(int
the starting position in the buffer (inclusive)
from
,
int
the number of characters to accumulate from the given start position
length
)

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

Removes a section from the appended content
public void
reset()

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

Clears the accumulated value and the whitespace count.
public final void
resetWhitespaceCount()

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

Resets the number of whitespaces accumulated after the last non-whitespace character.
public final String
subSequence(int
the start index, inclusive
from
,
int
the end index, exclusive
to
)

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.
public String
substring(int
the starting position in the buffer
from
,
int
the number of characters to accumulate from the given start position
length
)

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

Returns a section of the appended content
public final String

Returns:

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

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

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)

Does not discard the accumulated value.

public final void
updateWhitespace()

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

Updates the internal whitespace count of this appender to trim trailing whitespaces.
public final int
whitespaceCount()

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

Returns the current number of whitespaces accumulated after the last non-whitespace character.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

charsback to summary
pack-priv char[] chars
emptyCharsback to summary
pack-priv final char[] emptyChars
emptyValueback to summary
pack-priv final String emptyValue
indexback to summary
pack-priv int index
whitespaceCountback to summary
pack-priv int whitespaceCount
whitespaceRangeStartback to summary
pack-priv final int whitespaceRangeStart

Constructor Detail

DefaultCharAppenderback to summary
public DefaultCharAppender(int maxLength, String emptyValue, int whitespaceRangeStart)

Creates a DefaultCharAppender with a maximum limit of characters to append and the default value to return when no characters have been accumulated. The padding character is defaulted to a whitespace character ' '.

Parameters
maxLength:int

maximum limit of characters to append

emptyValue:String

default value to return when no characters have been accumulated

whitespaceRangeStart:int

starting range of characters considered to be whitespace.

Method Detail

appendback to summary
public void append(char ch)

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

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

Appends the given character.

Parameters
ch:char

the character to append

Annotations
@Override
appendback to summary
public final void append(Object o)

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

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

Appends the String representation of a given object.

Parameters
o:Object

the object whose String representation will be appended.

Annotations
@Override
appendback to summary
public final void append(int ch)

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

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

Appends the given codepoint.

Parameters
ch:int

the codepoint to append

Annotations
@Override
appendback to summary
public final void append(int[] ch)

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

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

Appends codepoints from an input array

Parameters
ch:int[]

the codepoint array

Annotations
@Override
appendback to summary
public void append(DefaultCharAppender appender)

Appends the contents of another DefaultCharAppender, discarding any of its trailing whitespace characters

Parameters
appender:DefaultCharAppender

The DefaultCharAppender instance got get contents from.

appendback to summary
public void append(char[] ch, int from, int length)

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

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

Appends characters from an input array

Parameters
ch:char[]

the character array

from:int

the position of the first character in the array to be appended

length:int

the number of characters to be appended from the given posiion.

Annotations
@Override
appendback to summary
public final void append(char[] ch)

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

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

Appends characters from an input array

Parameters
ch:char[]

the character array

Annotations
@Override
appendback to summary
public void append(String string, int from, int to)

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

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

Appends the contents of a String to this appender

Parameters
string:String

the string whose characters will be appended.

from:int

the index of the first character to append

to:int

the index of the last character to append

appendback to summary
public final void append(String string)

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

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

Appends characters from an input String

Parameters
string:String

the input String

Annotations
@Override
appendIgnoringPaddingback to summary
public void appendIgnoringPadding(char ch, char padding)

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

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

Appends the given character and marks it as ignored if it is a padding character (the definition of a padding character is implementation dependent.)

Parameters
ch:char

character to append

padding:char

the padding character to ignore

Annotations
@Override
appendIgnoringWhitespaceback to summary
public void appendIgnoringWhitespace(char ch)

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

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

Appends the given character and marks it as ignored if it is a whitespace (ch <= ' ')

Parameters
ch:char

character to append

Annotations
@Override
appendIgnoringWhitespaceAndPaddingback to summary
public void appendIgnoringWhitespaceAndPadding(char ch, char padding)

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

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

Appends the given character and marks it as ignored if it is a whitespace (ch <= ' ') or a padding character (the definition of a padding character is implementation dependent.)

Parameters
ch:char

character to append

padding:char

the padding character to ignore

Annotations
@Override
appendUntilback to summary
public char appendUntil(char ch, CharInput input, char stop)

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

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

Appends characters from the input, until a stop character is found

Parameters
ch:char

the first character of the input to be appended.

input:CharInput

the input whose the following characters will be appended

stop:char

the stop character

Returns:char

the stop character found on the input.

appendUntilback to summary
public char appendUntil(char ch, CharInput input, char stop1, char stop2)

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

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

Appends characters from the input, until a stop character is found

Parameters
ch:char

the first character of the input to be appended.

input:CharInput

the input whose the following characters will be appended

stop1:char

the first stop character

stop2:char

the second stop character

Returns:char

one of the stop characters found on the input.

appendUntilback to summary
public char appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)

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

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

Appends characters from the input, until a stop character is found

Parameters
ch:char

the first character of the input to be appended.

input:CharInput

the input whose the following characters will be appended

stop1:char

the first stop character

stop2:char

the second stop character

stop3:char

the third stop character

Returns:char

one of the stop characters found on the input.

charAtback to summary
public final char charAt(int i)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
i:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
deleteback to summary
public void delete(int count)

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

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

Deletes a given number of characters from the end of the appended content. Will reset the internal whitespace count if any. Invoke updateWhitespace() to recalculate the number of trailing whitespaces in the appended content.

Parameters
count:int

the number of characters to delete.

Annotations
@Override
fillback to summary
public void fill(char ch, int length)

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

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

Adds a sequence of repeated characters to the input.

Parameters
ch:char

the character to append

length:int

the number of times the given character should be appended.

Annotations
@Override
getAndResetback to summary
public String 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.

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
getCharsback to summary
public final char[] getChars()

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

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

Returns the internal character array.

Returns:char[]

the internal character array.

Annotations
@Override
getCharsAndResetback to summary
public char[] 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.

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
ignoreback to summary
public final void ignore(int count)

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

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

Ignores the given number of characters at the end of the appended content, effectively marking these as whitespace. Invoking resetWhitespaceCount() or updateWhitespace() will undo this effect.

Parameters
count:int

the number of characters to ignore

Annotations
@Override
indexOfback to summary
public int indexOf(char ch, int from)

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

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

Returns first the position of a given character

Parameters
ch:char

the character to look for

from:int

the starting index from where the search will begin.

Returns:int

the position of the given character in the appended content, -1 if not found

Annotations
@Override
indexOfback to summary
public int indexOf(char[] charSequence, int fromIndex)

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

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

Returns first the position of a given character sequence

Parameters
charSequence:char[]

the character sequence to look for

fromIndex:int

the starting index from where the search will begin.

Returns:int

the position of the given character sequence in the appended content, -1 if not found

Annotations
@Override
indexOfback to summary
public int indexOf(CharSequence charSequence, int fromIndex)

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

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

Returns first the position of a given character sequence

Parameters
charSequence:CharSequence

the character sequence to look for

fromIndex:int

the starting index from where the search will begin.

Returns:int

the position of the given character sequence in the appended content, -1 if not found

Annotations
@Override
indexOfAnyback to summary
public int indexOfAny(char[] chars, int from)

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

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

Returns the first position of any given character

Parameters
chars:char[]

the characters to look for

from:int

the starting index from where the search will begin.

Returns:int

the position any one of the given characters in the appended content, -1 if none found

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

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

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

Indicates whether this appender represents an empty String.

Returns:boolean

true calling getAndReset() would return null, otherwise false.

Annotations
@Override
lastIndexOfback to summary
public int lastIndexOf(char ch)

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

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

Returns the last index of a given character in the current appended (characters that have been marked as whitespace will be ignored)

Parameters
ch:char

the character to look for

Returns:int

the last position of the given character in the appended content, or -1 if not found.

Annotations
@Override
lengthback to summary
public final int length()

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

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

Returns the current accumulated value length (the sum of all appended characters - whitespaceCount).

Returns:int

the current accumulated value length (the sum of all appended characters - whitespaceCount).

Annotations
@Override
prependback to summary
public void prepend(char ch)

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

Prepends the current accumulated value with a character

Parameters
ch:char

the character to prepend in front of the current accumulated value.

Annotations
@Override
prependback to summary
public void prepend(char ch1, char ch2)

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

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

Prepends the current accumulated value with a couple of characters

Parameters
ch1:char

the first character to prepend in front of the current accumulated value.

ch2:char

the second character to prepend in front of the current accumulated value.

Annotations
@Override
prependback to summary
public void prepend(char[] chars)

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

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

Prepends the current accumulated value a sequence of characters

Parameters
chars:char[]

the character sequence to prepend in front of the current accumulated value.

Annotations
@Override
removeback to summary
public void remove(int from, int length)

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

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

Removes a section from the appended content

Parameters
from:int

the starting position in the buffer (inclusive)

length:int

the number of characters to accumulate from the given start position

Annotations
@Override
resetback to summary
public void 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
resetWhitespaceCountback to summary
public final void resetWhitespaceCount()

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

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

Resets the number of whitespaces accumulated after the last non-whitespace character.

This is the number of whitespaces accumulated using CharAppender#appendIgnoringWhitespace(char), CharAppender#appendIgnoringPadding(char, char) or CharAppender#appendIgnoringWhitespaceAndPadding(char, char)

A subsequent call to CharAppender#whitespaceCount() should return 0.

Annotations
@Override
subSequenceback to summary
public final String subSequence(int from, int to)

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
from:int

the start index, inclusive

to:int

the end index, exclusive

Returns:String

the specified subsequence

Annotations
@Override
substringback to summary
public String substring(int from, int length)

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

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

Returns a section of the appended content

Parameters
from:int

the starting position in the buffer

length:int

the number of characters to accumulate from the given start position

Returns:String

a String with the section of characters accumulated by this appender.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

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)

Does not discard the accumulated value.

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
updateWhitespaceback to summary
public final void updateWhitespace()

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

Updates the internal whitespace count of this appender to trim trailing whitespaces.

whitespaceCountback to summary
public final int whitespaceCount()

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

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

Returns the current number of whitespaces accumulated after the last non-whitespace character.

This is the number of whitespaces accumulated using CharAppender#appendIgnoringWhitespace(char), CharAppender#appendIgnoringPadding(char, char) or CharAppender#appendIgnoringWhitespaceAndPadding(char, char)

Returns:int

the number of whitespaces accumulated using CharAppender#appendIgnoringWhitespace(char), CharAppender#appendIgnoringPadding(char, char) or CharAppender#appendIgnoringWhitespaceAndPadding(char, char)

Annotations
@Override