Class NoopCharAppender
java.lang.Object
com.univocity.parsers.common.input.NoopCharAppender
- All Implemented Interfaces:
CharAppender,CharSequence
An implementation of
CharAppender that does nothing. Used by ParserOutput to transparently discard any unwanted input while parsing.- Author:
- Univocity Software Pty Ltd - parsers@univocity.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidappend(char ch) Does nothingvoidappend(char[] ch) Does nothingvoidappend(char[] ch, int from, int length) Does nothingvoidappend(int ch) Does nothingvoidappend(int[] ch) Does nothingvoidDoes nothingvoidDoes nothingvoidDoes 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 foundfinal charappendUntil(char ch, CharInput input, char stop1, char stop2) Appends characters from the input, until a stop character is foundfinal charappendUntil(char ch, CharInput input, char stop1, char stop2, char stop3) Appends characters from the input, until a stop character is foundcharcharAt(int i) Does nothingvoiddelete(int count) Does nothingvoidfill(char ch, int length) Does nothingReturns null as this appender does nothing.char[]getChars()Does nothingchar[]Returns null as this appender does nothing.static CharAppenderReturns the singleton instance of NoopCharAppendervoidignore(int count) Does nothingintindexOf(char[] charSequence, int from) Does nothingintindexOf(char ch, int from) Does nothingintindexOf(CharSequence charSequence, int from) Does nothingintindexOfAny(char[] chars, int from) Does nothingbooleanisEmpty()Returnstrueas it's always empty.intlastIndexOf(char ch) Returns the last index of a given character in the current appended (characters that have been marked as whitespace will be ignored)intlength()Returns -1 as this appender does nothing.voidprepend(char ch) Does nothingvoidprepend(char[] chars) Does nothingvoidprepend(char ch1, char ch2) Does nothingvoidremove(int from, int length) Does nothingvoidreset()Does nothingvoidDoes nothingsubSequence(int i, int i1) Does nothingsubstring(int from, int length) Does nothingvoidDoes nothingintReturns 0 as this appender does nothing.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, toString
-
Method Details
-
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 interfaceCharSequence- Returns:
- -1 as this appender does nothing.
-
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
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
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
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
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
string- the input String
-
append
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 interfaceCharSequence
-
subSequence
Does nothing- Specified by:
subSequencein interfaceCharSequence
-
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
-
append
Does nothing- Specified by:
appendin interfaceCharAppender- Parameters:
obj- the object whoseStringrepresentation will be appended.
-
ignore
public void ignore(int count) Does nothing- Specified by:
ignorein interfaceCharAppender- Parameters:
count- the number of characters to ignore
-
indexOf
public int indexOf(char ch, int from) Does nothing- Specified by:
indexOfin interfaceCharAppender- Parameters:
ch- the character to look forfrom- the starting index from where the search will begin.- Returns:
- the position of the given character in the appended content,
-1if not found
-
substring
Does nothing- Specified by:
substringin interfaceCharAppender- Parameters:
from- the starting position in the bufferlength- the number of characters to accumulate from the given start position- Returns:
- a
Stringwith the section of characters accumulated by this appender.
-
remove
public void remove(int from, int length) Does nothing- Specified by:
removein interfaceCharAppender- Parameters:
from- the starting position in the buffer (inclusive)length- the number of characters to accumulate from the given start position
-
delete
public void delete(int count) Does nothing- Specified by:
deletein interfaceCharAppender- Parameters:
count- the number of characters to delete.
-
indexOfAny
public int indexOfAny(char[] chars, int from) Does nothing- Specified by:
indexOfAnyin interfaceCharAppender- Parameters:
chars- the characters to look forfrom- the starting index from where the search will begin.- Returns:
- the position any one of the given characters in the appended content,
-1if none found
-
indexOf
public int indexOf(char[] charSequence, int from) Does nothing- Specified by:
indexOfin interfaceCharAppender- Parameters:
charSequence- the character sequence to look forfrom- the starting index from where the search will begin.- Returns:
- the position of the given character sequence in the appended content,
-1if not found
-
indexOf
Does nothing- Specified by:
indexOfin interfaceCharAppender- Parameters:
charSequence- the character sequence to look forfrom- the starting index from where the search will begin.- Returns:
- the position of the given character sequence in the appended content,
-1if not found
-
isEmpty
public boolean isEmpty()Returnstrueas it's always empty.- Specified by:
isEmptyin interfaceCharAppender- Specified by:
isEmptyin interfaceCharSequence- Returns:
- true calling
CharAppender.getAndReset()would returnnull, otherwisefalse.
-
lastIndexOf
public int lastIndexOf(char ch) Description copied from interface:CharAppenderReturns the last index of a given character in the current appended (characters that have been marked as whitespace will be ignored)- Specified by:
lastIndexOfin interfaceCharAppender- Parameters:
ch- the character to look for- Returns:
- the last position of the given character in the appended content, or
-1if not found.
-