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 ofCharAppenderthat does nothing. Used byParserOutputto 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 voidappend(char ch)Does nothingvoidappend(char[] ch)Does nothingvoidappend(char[] ch, int from, int length)Does nothingvoidappend(int ch)Does nothingvoidappend(int[] ch)Does nothingvoidappend(java.lang.String string)Does nothingvoidappend(java.lang.String string, int from, int to)Does nothingvoidappendIgnoringPadding(char ch, char padding)Does nothingvoidappendIgnoringWhitespace(char ch)Does nothingvoidappendIgnoringWhitespaceAndPadding(char ch, char padding)Does nothingcharappendUntil(char ch, CharInput input, char stop)Appends characters from the input, until a stop character is foundcharappendUntil(char ch, CharInput input, char stop1, char stop2)Appends characters from the input, until a stop character is foundcharappendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)Appends characters from the input, until a stop character is foundcharcharAt(int i)Does nothingvoidfill(char ch, int length)Does nothingjava.lang.StringgetAndReset()Returns null as this appender does nothing.char[]getChars()Does nothingchar[]getCharsAndReset()Returns null as this appender does nothing.static CharAppendergetInstance()Returns the singleton instance of NoopCharAppenderintlength()Returns -1 as this appender does nothing.voidprepend(char ch)Does nothingvoidprepend(char[] chars)Does nothingvoidprepend(char ch1, char ch2)Does nothingvoidreset()Does nothingvoidresetWhitespaceCount()Does nothingjava.lang.CharSequencesubSequence(int i, int i1)Does nothingvoidupdateWhitespace()Does nothingintwhitespaceCount()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:
lengthin interfaceCharAppender- Specified by:
lengthin 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:
getAndResetin interfaceCharAppender- Returns:
- null as this appender does nothing.
-
appendIgnoringWhitespace
public void appendIgnoringWhitespace(char ch)
Does nothing- Specified by:
appendIgnoringWhitespacein interfaceCharAppender- Parameters:
ch- character to append
-
append
public void append(char ch)
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
ch- the character to append
-
getCharsAndReset
public char[] getCharsAndReset()
Returns null as this appender does nothing.- Specified by:
getCharsAndResetin interfaceCharAppender- Returns:
- null as this appender does nothing.
-
whitespaceCount
public int whitespaceCount()
Returns 0 as this appender does nothing.- Specified by:
whitespaceCountin interfaceCharAppender- Returns:
- 0 as this appender does nothing.
-
reset
public void reset()
Does nothing- Specified by:
resetin interfaceCharAppender
-
resetWhitespaceCount
public void resetWhitespaceCount()
Does nothing- Specified by:
resetWhitespaceCountin interfaceCharAppender
-
getChars
public char[] getChars()
Does nothing- Specified by:
getCharsin interfaceCharAppender- Returns:
- the internal character array.
-
fill
public void fill(char ch, int length)Does nothing- Specified by:
fillin 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:
appendIgnoringPaddingin interfaceCharAppender- Parameters:
ch- character to appendpadding- the padding character to ignore
-
appendIgnoringWhitespaceAndPadding
public void appendIgnoringWhitespaceAndPadding(char ch, char padding)Does nothing- Specified by:
appendIgnoringWhitespaceAndPaddingin interfaceCharAppender- Parameters:
ch- character to appendpadding- the padding character to ignore
-
prepend
public void prepend(char ch)
Does nothing- Specified by:
prependin interfaceCharAppender- Parameters:
ch- the character to prepend in front of the current accumulated value.
-
updateWhitespace
public void updateWhitespace()
Does nothing- Specified by:
updateWhitespacein interfaceCharAppender
-
appendUntil
public char appendUntil(char ch, CharInput input, char stop)Description copied from interface:CharAppenderAppends characters from the input, until a stop character is found- Specified by:
appendUntilin 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:CharAppenderAppends characters from the input, until a stop character is found- Specified by:
appendUntilin 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:CharAppenderAppends characters from the input, until a stop character is found- Specified by:
appendUntilin 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:
appendin 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:
prependin 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:
prependin 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:
appendin interfaceCharAppender- Parameters:
ch- the character array
-
append
public void append(java.lang.String string)
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
string- the input String
-
append
public void append(java.lang.String string, int from, int to)Does nothing- Specified by:
appendin 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:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int i, int i1)Does nothing- Specified by:
subSequencein interfacejava.lang.CharSequence
-
append
public void append(int ch)
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
ch- the codepoint to append
-
append
public void append(int[] ch)
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
ch- the codepoint array
-
-