Class NoopCharAppender
- java.lang.Object
-
- com.univocity.parsers.common.input.NoopCharAppender
-
- All Implemented Interfaces:
CharAppender
,java.lang.CharSequence
public class NoopCharAppender extends java.lang.Object implements CharAppender
An implementation ofCharAppender
that does nothing. Used byParserOutput
to transparently discard any unwanted input while parsing.- Author:
- uniVocity Software Pty Ltd - parsers@univocity.com
- See Also:
ParserOutput
,CharAppender
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(char ch)
Does nothingvoid
append(char[] ch)
Does nothingvoid
append(char[] ch, int from, int length)
Does nothingvoid
append(int ch)
Does nothingvoid
append(int[] ch)
Does nothingvoid
append(java.lang.String string)
Does nothingvoid
append(java.lang.String string, int from, int to)
Does nothingvoid
appendIgnoringPadding(char ch, char padding)
Does nothingvoid
appendIgnoringWhitespace(char ch)
Does nothingvoid
appendIgnoringWhitespaceAndPadding(char ch, char padding)
Does nothingchar
appendUntil(char ch, CharInput input, char stop)
Appends characters from the input, until a stop character is foundchar
appendUntil(char ch, CharInput input, char stop1, char stop2)
Appends characters from the input, until a stop character is foundchar
appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)
Appends characters from the input, until a stop character is foundchar
charAt(int i)
Does nothingvoid
fill(char ch, int length)
Does nothingjava.lang.String
getAndReset()
Returns null as this appender does nothing.char[]
getChars()
Does nothingchar[]
getCharsAndReset()
Returns null as this appender does nothing.static CharAppender
getInstance()
Returns the singleton instance of NoopCharAppenderint
length()
Returns -1 as this appender does nothing.void
prepend(char ch)
Does nothingvoid
prepend(char[] chars)
Does nothingvoid
prepend(char ch1, char ch2)
Does nothingvoid
reset()
Does nothingvoid
resetWhitespaceCount()
Does nothingjava.lang.CharSequence
subSequence(int i, int i1)
Does nothingvoid
updateWhitespace()
Does nothingint
whitespaceCount()
Returns 0 as this appender does nothing.
-
-
-
Method Detail
-
getInstance
public static CharAppender getInstance()
Returns the singleton instance of NoopCharAppender- Returns:
- the singleton instance of NoopCharAppender
-
length
public int length()
Returns -1 as this appender does nothing.- Specified by:
length
in interfaceCharAppender
- Specified by:
length
in interfacejava.lang.CharSequence
- Returns:
- -1 as this appender does nothing.
-
getAndReset
public java.lang.String getAndReset()
Returns null as this appender does nothing.- Specified by:
getAndReset
in interfaceCharAppender
- Returns:
- null as this appender does nothing.
-
appendIgnoringWhitespace
public void appendIgnoringWhitespace(char ch)
Does nothing- Specified by:
appendIgnoringWhitespace
in interfaceCharAppender
- Parameters:
ch
- character to append
-
append
public void append(char ch)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
ch
- the character to append
-
getCharsAndReset
public char[] getCharsAndReset()
Returns null as this appender does nothing.- Specified by:
getCharsAndReset
in interfaceCharAppender
- Returns:
- null as this appender does nothing.
-
whitespaceCount
public int whitespaceCount()
Returns 0 as this appender does nothing.- Specified by:
whitespaceCount
in interfaceCharAppender
- Returns:
- 0 as this appender does nothing.
-
reset
public void reset()
Does nothing- Specified by:
reset
in interfaceCharAppender
-
resetWhitespaceCount
public void resetWhitespaceCount()
Does nothing- Specified by:
resetWhitespaceCount
in interfaceCharAppender
-
getChars
public char[] getChars()
Does nothing- Specified by:
getChars
in interfaceCharAppender
- Returns:
- the internal character array.
-
fill
public void fill(char ch, int length)
Does nothing- Specified by:
fill
in interfaceCharAppender
- Parameters:
ch
- the character to appendlength
- the number of times the given character should be appended.
-
appendIgnoringPadding
public void appendIgnoringPadding(char ch, char padding)
Does nothing- Specified by:
appendIgnoringPadding
in interfaceCharAppender
- Parameters:
ch
- character to appendpadding
- the padding character to ignore
-
appendIgnoringWhitespaceAndPadding
public void appendIgnoringWhitespaceAndPadding(char ch, char padding)
Does nothing- Specified by:
appendIgnoringWhitespaceAndPadding
in interfaceCharAppender
- Parameters:
ch
- character to appendpadding
- the padding character to ignore
-
prepend
public void prepend(char ch)
Does nothing- Specified by:
prepend
in interfaceCharAppender
- Parameters:
ch
- the character to prepend in front of the current accumulated value.
-
updateWhitespace
public void updateWhitespace()
Does nothing- Specified by:
updateWhitespace
in interfaceCharAppender
-
appendUntil
public char appendUntil(char ch, CharInput input, char stop)
Description copied from interface:CharAppender
Appends characters from the input, until a stop character is found- Specified by:
appendUntil
in interfaceCharAppender
- Parameters:
ch
- the first character of the input to be appended.input
- the input whose the following characters will be appendedstop
- the stop character- Returns:
- the stop character found on the input.
-
appendUntil
public final char appendUntil(char ch, CharInput input, char stop1, char stop2)
Description copied from interface:CharAppender
Appends characters from the input, until a stop character is found- Specified by:
appendUntil
in interfaceCharAppender
- Parameters:
ch
- the first character of the input to be appended.input
- the input whose the following characters will be appendedstop1
- the first stop characterstop2
- the second stop character- Returns:
- one of the stop characters found on the input.
-
appendUntil
public final char appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)
Description copied from interface:CharAppender
Appends characters from the input, until a stop character is found- Specified by:
appendUntil
in interfaceCharAppender
- Parameters:
ch
- the first character of the input to be appended.input
- the input whose the following characters will be appendedstop1
- the first stop characterstop2
- the second stop characterstop3
- the third stop character- Returns:
- one of the stop characters found on the input.
-
append
public void append(char[] ch, int from, int length)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
ch
- the character arrayfrom
- the position of the first character in the array to be appendedlength
- the number of characters to be appended from the given posiion.
-
prepend
public void prepend(char ch1, char ch2)
Does nothing- Specified by:
prepend
in interfaceCharAppender
- Parameters:
ch1
- the first character to prepend in front of the current accumulated value.ch2
- the second character to prepend in front of the current accumulated value.
-
prepend
public void prepend(char[] chars)
Does nothing- Specified by:
prepend
in interfaceCharAppender
- Parameters:
chars
- the character sequence to prepend in front of the current accumulated value.
-
append
public void append(char[] ch)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
ch
- the character array
-
append
public void append(java.lang.String string)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
string
- the input String
-
append
public void append(java.lang.String string, int from, int to)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
string
- the string whose characters will be appended.from
- the index of the first character to appendto
- the index of the last character to append
-
charAt
public char charAt(int i)
Does nothing- Specified by:
charAt
in interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int i, int i1)
Does nothing- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
append
public void append(int ch)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
ch
- the codepoint to append
-
append
public void append(int[] ch)
Does nothing- Specified by:
append
in interfaceCharAppender
- Parameters:
ch
- the codepoint array
-
-