public class NoopCharAppender extends Object implements CharAppender
CharAppender
that does nothing. Used by ParserOutput
to transparently discard any unwanted input while parsing.ParserOutput
,
CharAppender
Modifier and Type | Method and Description |
---|---|
void |
append(char ch)
Does nothing
|
void |
append(char[] ch)
Does nothing
|
void |
append(char[] ch,
int from,
int length)
Does nothing
|
void |
append(int ch)
Does nothing
|
void |
append(int[] ch)
Does nothing
|
void |
append(String string)
Does nothing
|
void |
append(String string,
int from,
int to)
Does nothing
|
void |
appendIgnoringPadding(char ch,
char padding)
Does nothing
|
void |
appendIgnoringWhitespace(char ch)
Does nothing
|
void |
appendIgnoringWhitespaceAndPadding(char ch,
char padding)
Does nothing
|
char |
appendUntil(char ch,
CharInput input,
char stop)
Appends characters from the input, until a stop character is found
|
char |
appendUntil(char ch,
CharInput input,
char stop1,
char stop2)
Appends characters from the input, until a stop character is found
|
char |
appendUntil(char ch,
CharInput input,
char stop1,
char stop2,
char stop3)
Appends characters from the input, until a stop character is found
|
char |
charAt(int i)
Does nothing
|
void |
fill(char ch,
int length)
Does nothing
|
String |
getAndReset()
Returns null as this appender does nothing.
|
char[] |
getChars()
Does nothing
|
char[] |
getCharsAndReset()
Returns null as this appender does nothing.
|
static CharAppender |
getInstance()
Returns the singleton instance of NoopCharAppender
|
int |
length()
Returns -1 as this appender does nothing.
|
void |
prepend(char ch)
Does nothing
|
void |
prepend(char[] chars)
Does nothing
|
void |
prepend(char ch1,
char ch2)
Does nothing
|
void |
reset()
Does nothing
|
void |
resetWhitespaceCount()
Does nothing
|
CharSequence |
subSequence(int i,
int i1)
Does nothing
|
void |
updateWhitespace()
Does nothing
|
int |
whitespaceCount()
Returns 0 as this appender does nothing.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
chars, codePoints, toString
public static CharAppender getInstance()
public int length()
length
in interface CharAppender
length
in interface CharSequence
public String getAndReset()
getAndReset
in interface CharAppender
public void appendIgnoringWhitespace(char ch)
appendIgnoringWhitespace
in interface CharAppender
ch
- character to appendpublic void append(char ch)
append
in interface CharAppender
ch
- the character to appendpublic char[] getCharsAndReset()
getCharsAndReset
in interface CharAppender
public int whitespaceCount()
whitespaceCount
in interface CharAppender
public void reset()
reset
in interface CharAppender
public void resetWhitespaceCount()
resetWhitespaceCount
in interface CharAppender
public char[] getChars()
getChars
in interface CharAppender
public void fill(char ch, int length)
fill
in interface CharAppender
ch
- the character to appendlength
- the number of times the given character should be appended.public void appendIgnoringPadding(char ch, char padding)
appendIgnoringPadding
in interface CharAppender
ch
- character to appendpadding
- the padding character to ignorepublic void appendIgnoringWhitespaceAndPadding(char ch, char padding)
appendIgnoringWhitespaceAndPadding
in interface CharAppender
ch
- character to appendpadding
- the padding character to ignorepublic void prepend(char ch)
prepend
in interface CharAppender
ch
- the character to prepend in front of the current accumulated value.public void updateWhitespace()
updateWhitespace
in interface CharAppender
public char appendUntil(char ch, CharInput input, char stop)
CharAppender
appendUntil
in interface CharAppender
ch
- the first character of the input to be appended.input
- the input whose the following characters will be appendedstop
- the stop characterpublic final char appendUntil(char ch, CharInput input, char stop1, char stop2)
CharAppender
appendUntil
in interface CharAppender
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 characterpublic final char appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3)
CharAppender
appendUntil
in interface CharAppender
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 characterpublic void append(char[] ch, int from, int length)
append
in interface CharAppender
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.public void prepend(char ch1, char ch2)
prepend
in interface CharAppender
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.public void prepend(char[] chars)
prepend
in interface CharAppender
chars
- the character sequence to prepend in front of the current accumulated value.public void append(char[] ch)
append
in interface CharAppender
ch
- the character arraypublic void append(String string)
append
in interface CharAppender
string
- the input Stringpublic void append(String string, int from, int to)
append
in interface CharAppender
string
- the string whose characters will be appended.from
- the index of the first character to appendto
- the index of the last character to appendpublic char charAt(int i)
charAt
in interface CharSequence
public CharSequence subSequence(int i, int i1)
subSequence
in interface CharSequence
public void append(int ch)
append
in interface CharAppender
ch
- the codepoint to appendpublic void append(int[] ch)
append
in interface CharAppender
ch
- the codepoint arrayCopyright © 2020 uniVocity Software Pty Ltd. All rights reserved.