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

public Class ExpandingCharAppender

extends DefaultCharAppender
Class Inheritance
Known Direct Subclasses
com.univocity.parsers.common.input.WriterCharAppender, com.univocity.parsers.common.input.ElasticCharAppender
Imports
com.univocity.parsers.common.*, java.util.*

An implementation CharAppender that expands the internal buffer of characters as required.
Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
private static final int
Inherited from com.univocity.parsers.common.input.DefaultCharAppender:
charsemptyCharsemptyValueindexwhitespaceCountwhitespaceRangeStart

Constructor Summary

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

Creates an ExpandingCharAppender a the default value to return when no characters have been accumulated.

public
ExpandingCharAppender(int
the initial length of the internal buffer.
initialBufferLength
,
String
default value to return when no characters have been accumulated
emptyValue
,
int
starting range of characters considered to be whitespace.
whitespaceRangeStart
)

Creates an ExpandingCharAppender a 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
)

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

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

Appends the given character.
public final void
append(DefaultCharAppender
The DefaultCharAppender instance got get contents from.
appender
)

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

Appends the contents of another DefaultCharAppender, discarding any of its trailing whitespace characters
public final 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
)

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

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

Appends characters from an input array
public final 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
)

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

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

Appends the contents of a String to this appender
public void
appendIgnoringPadding(char
character to append
ch
,
char
the padding character to ignore
padding
)

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

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
)

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

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
)

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

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 final 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
)

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

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

Appends characters from the input, until a stop character is found
public final 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
)

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

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

Appends characters from the input, until a stop character is found
public final 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
)

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

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

Appends characters from the input, until a stop character is found
private void
expand(int additionalLength, double factor)

pack-priv final void
pack-priv final void
expand(int additionalLength)

pack-priv final void
public final void
fill(char
the character to append
ch
,
int
the number of times the given character should be appended.
length
)

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

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

Adds a sequence of repeated characters to the input.
public final void
prepend(char
the character to prepend in front of the current accumulated value.
ch
)

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

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

Prepends the current accumulated value with a character
public final 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
)

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

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

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

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

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

Prepends the current accumulated value a sequence of characters
Inherited from com.univocity.parsers.common.input.DefaultCharAppender:
appendappendappendappendappendcharAtdeletegetAndResetgetCharsgetCharsAndResetignoreindexOfindexOfindexOfindexOfAnyisEmptylastIndexOflengthremoveresetresetWhitespaceCountsubSequencesubstringtoStringupdateWhitespacewhitespaceCount

Field Detail

MAX_ARRAY_LENGTHback to summary
private static final int MAX_ARRAY_LENGTH

Constructor Detail

ExpandingCharAppenderback to summary
public ExpandingCharAppender(String emptyValue, int whitespaceRangeStart)

Creates an ExpandingCharAppender a the default value to return when no characters have been accumulated. The padding character is defaulted to a whitespace character ' '.

Parameters
emptyValue:String

default value to return when no characters have been accumulated

whitespaceRangeStart:int

starting range of characters considered to be whitespace.

ExpandingCharAppenderback to summary
public ExpandingCharAppender(int initialBufferLength, String emptyValue, int whitespaceRangeStart)

Creates an ExpandingCharAppender a the default value to return when no characters have been accumulated. The padding character is defaulted to a whitespace character ' '.

Parameters
initialBufferLength:int

the initial length of the internal buffer.

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)

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

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(DefaultCharAppender appender)

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

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

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 final void append(char[] ch, int from, int length)

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

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(String string, int from, int to)

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

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

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

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

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)

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

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)

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

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 final char appendUntil(char ch, CharInput input, char stop)

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

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 final char appendUntil(char ch, CharInput input, char stop1, char stop2)

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

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 final char appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)

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

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.

expandback to summary
private void expand(int additionalLength, double factor)
expandback to summary
pack-priv final void expand()
expandback to summary
pack-priv final void expand(int additionalLength)
expandAndRetryback to summary
pack-priv final void expandAndRetry()
fillback to summary
public final void fill(char ch, int length)

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

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
prependback to summary
public final void prepend(char ch)

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

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

Doc from com.univocity.parsers.common.input.DefaultCharAppender.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 final void prepend(char ch1, char ch2)

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

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 final void prepend(char[] chars)

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

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