com.univocity.parsers.common.input
Class NoopCharAppender

java.lang.Object
  extended by com.univocity.parsers.common.input.NoopCharAppender
All Implemented Interfaces:
CharAppender, CharSequence

public class NoopCharAppender
extends Object
implements CharAppender

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:
ParserOutput, CharAppender

Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.CharSequence
toString
 

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 interface CharAppender
Specified by:
length in interface CharSequence
Returns:
-1 as this appender does nothing.

getAndReset

public String getAndReset()
Returns null as this appender does nothing.

Specified by:
getAndReset in interface CharAppender
Returns:
null as this appender does nothing.

appendIgnoringWhitespace

public void appendIgnoringWhitespace(char ch)
Does nothing

Specified by:
appendIgnoringWhitespace in interface CharAppender
Parameters:
ch - character to append

append

public void append(char ch)
Does nothing

Specified by:
append in interface CharAppender
Parameters:
ch - the character to append

getCharsAndReset

public char[] getCharsAndReset()
Returns null as this appender does nothing.

Specified by:
getCharsAndReset in interface CharAppender
Returns:
null as this appender does nothing.

whitespaceCount

public int whitespaceCount()
Returns 0 as this appender does nothing.

Specified by:
whitespaceCount in interface CharAppender
Returns:
0 as this appender does nothing.

reset

public void reset()
Does nothing

Specified by:
reset in interface CharAppender

resetWhitespaceCount

public void resetWhitespaceCount()
Does nothing

Specified by:
resetWhitespaceCount in interface CharAppender

getChars

public char[] getChars()
Does nothing

Specified by:
getChars in interface CharAppender
Returns:
the internal character array.

fill

public void fill(char ch,
                 int length)
Does nothing

Specified by:
fill in interface CharAppender
Parameters:
ch - the character to append
length - the number of times the given character should be appended.

appendIgnoringPadding

public void appendIgnoringPadding(char ch,
                                  char padding)
Does nothing

Specified by:
appendIgnoringPadding in interface CharAppender
Parameters:
ch - character to append
padding - the padding character to ignore

appendIgnoringWhitespaceAndPadding

public void appendIgnoringWhitespaceAndPadding(char ch,
                                               char padding)
Does nothing

Specified by:
appendIgnoringWhitespaceAndPadding in interface CharAppender
Parameters:
ch - character to append
padding - the padding character to ignore

prepend

public void prepend(char ch)
Does nothing

Specified by:
prepend in interface CharAppender
Parameters:
ch - the character to prepend in front of the current accumulated value.

updateWhitespace

public void updateWhitespace()
Does nothing

Specified by:
updateWhitespace in interface CharAppender

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 interface CharAppender
Parameters:
ch - the first character of the input to be appended.
input - the input whose the following characters will be appended
stop - 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 interface CharAppender
Parameters:
ch - the first character of the input to be appended.
input - the input whose the following characters will be appended
stop1 - the first stop character
stop2 - 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 interface CharAppender
Parameters:
ch - the first character of the input to be appended.
input - the input whose the following characters will be appended
stop1 - the first stop character
stop2 - the second stop character
stop3 - 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 interface CharAppender
Parameters:
ch - the character array
from - the position of the first character in the array to be appended
length - 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 interface CharAppender
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 interface CharAppender
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 interface CharAppender
Parameters:
ch - the character array

append

public void append(String string)
Does nothing

Specified by:
append in interface CharAppender
Parameters:
string - the input String

append

public void append(String string,
                   int from,
                   int to)
Does nothing

Specified by:
append in interface CharAppender
Parameters:
string - the string whose characters will be appended.
from - the index of the first character to append
to - the index of the last character to append

charAt

public char charAt(int i)
Does nothing

Specified by:
charAt in interface CharSequence

subSequence

public CharSequence subSequence(int i,
                                int i1)
Does nothing

Specified by:
subSequence in interface CharSequence

append

public void append(int ch)
Does nothing

Specified by:
append in interface CharAppender
Parameters:
ch - the codepoint to append

append

public void append(int[] ch)
Does nothing

Specified by:
append in interface CharAppender
Parameters:
ch - the codepoint array


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.