CharAppender interface
| Modifier and Type | Field and Description |
|---|---|
| pack-priv char[] | |
| pack-priv final char[] | |
| pack-priv final String | |
| pack-priv int | |
| pack-priv int | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| public | DefaultCharAppender(int
maximum limit of characters to append maxLength, String default value to return when no characters have been accumulated emptyValue, int starting range of characters considered to be whitespace. whitespaceRangeStart)Creates a DefaultCharAppender with a maximum limit of characters to append and the default value to return when no characters have been accumulated. |
| Modifier and Type | Method and Description |
|---|---|
| public void | append(char
the character to append ch)Implements com. |
| public final void | append(Object
the object whose o)String representation will be appended.Implements com. String representation of a given object.
|
| public final void | append(int
the codepoint to append ch)Implements com. |
| public final void | append(int[]
the codepoint array ch)Implements com. |
| public void | append(DefaultCharAppender
The DefaultCharAppender instance got get contents from. appender)Appends the contents of another DefaultCharAppender, discarding any of its trailing whitespace characters |
| public void | append(char[]
the character array ch, int the position of the first character in the array to be appended from, int the number of characters to be appended from the given posiion. length)Implements com. |
| public final void | append(char[]
the character array ch)Implements com. |
| public void | append(String
the string whose characters will be appended. string, int the index of the first character to append from, int the index of the last character to append to)Implements com. |
| public final void | append(String
the input String string)Implements com. String
|
| public void | appendIgnoringPadding(char
character to append ch, char the padding character to ignore padding)Implements com. |
| public void | appendIgnoringWhitespace(char
character to append ch)Implements com. ch <= ' ')
|
| public void | appendIgnoringWhitespaceAndPadding(char
character to append ch, char the padding character to ignore padding)Implements com. ch <= ' ') or a padding character (the definition of a padding character is implementation dependent.)
|
| public char | appendUntil(char
the first character of the input to be appended. ch, CharInput the input whose the following characters will be appended input, char the stop character stop)Implements com. |
| public char | appendUntil(char
the first character of the input to be appended. ch, CharInput the input whose the following characters will be appended input, char the first stop character stop1, char the second stop character stop2)Implements com. |
| public char | appendUntil(char
the first character of the input to be appended. ch, CharInput the input whose the following characters will be appended input, char the first stop character stop1, char the second stop character stop2, char the third stop character stop3)Implements com. |
| public final char | charAt(int
the index of the i)char value to be returnedImplements java. char value at the specified index.
|
| public void | delete(int
the number of characters to delete. count)Implements com. |
| public void | fill(char
the character to append ch, int the number of times the given character should be appended. length)Implements com. |
| public String | Returns: a String containing the accumulated characters without the trailing white spaces. Or theDefaultCharAppender#emptyValue defined in the constructor of this class.Implements com. DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)
The internal accumulated value is discarded after invoking this method (as in If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be |
| public final char[] | getChars()
Implements com. |
| public char[] | Returns: a character array containing the accumulated characters without the trailing white spaces. Or the characters of theDefaultCharAppender#emptyValue defined in the constructor of this class.Implements com. DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)
The internal accumulated value is discarded after invoking this method (as in If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be character sequence of the |
| public final void | ignore(int
the number of characters to ignore count)Implements com. |
| public int | indexOf(char
the character to look for ch, int the starting index from where the search will begin. from)Implements com. |
| public int | indexOf(char[]
the character sequence to look for charSequence, int the starting index from where the search will begin. fromIndex)Implements com. |
| public int | indexOf(CharSequence
the character sequence to look for charSequence, int the starting index from where the search will begin. fromIndex)Implements com. |
| public int | indexOfAny(char[]
the characters to look for chars, int the starting index from where the search will begin. from)Implements com. |
| public boolean | isEmpty()
Implements com. String.
|
| public int | lastIndexOf(char
the character to look for ch)Implements com. |
| public final int | length()
Implements com. |
| public void | prepend(char
the character to prepend in front of the current accumulated value. ch)Implements com. |
| public void | prepend(char
the first character to prepend in front of the current accumulated value. ch1, char the second character to prepend in front of the current accumulated value. ch2)Implements com. |
| public void | prepend(char[]
the character sequence to prepend in front of the current accumulated value. chars)Implements com. |
| public void | remove(int
the starting position in the buffer (inclusive) from, int the number of characters to accumulate from the given start position length)Implements com. |
| public void | reset()
Implements com. |
| public final void | resetWhitespaceCount()
Implements com. |
| public final String | subSequence(int
the start index, inclusive from, int the end index, exclusive to)Implements java. CharSequence that is a subsequence of this sequence.
|
| public String | substring(int
the starting position in the buffer from, int the number of characters to accumulate from the given start position length)Implements com. |
| public final String | Returns: a String containing the accumulated characters without the trailing white spaces. Or theDefaultCharAppender#emptyValue defined in the constructor of this class.Overrides java. Implements java. DefaultCharAppender#appendIgnoringWhitespace(char), DefaultCharAppender#appendIgnoringPadding(char, char) or DefaultCharAppender#appendIgnoringWhitespaceAndPadding(char, char)
Does not discard the accumulated value. |
| public final void | updateWhitespace()
Implements com. |
| public final int | whitespaceCount()
Implements com. |
| chars | back to summary |
|---|---|
| pack-priv char[] chars | |
| emptyChars | back to summary |
|---|---|
| pack-priv final char[] emptyChars | |
| emptyValue | back to summary |
|---|---|
| pack-priv final String emptyValue | |
| index | back to summary |
|---|---|
| pack-priv int index | |
| whitespaceCount | back to summary |
|---|---|
| pack-priv int whitespaceCount | |
| whitespaceRangeStart | back to summary |
|---|---|
| pack-priv final int whitespaceRangeStart | |
| DefaultCharAppender | back to summary |
|---|---|
| public DefaultCharAppender(int maxLength, String emptyValue, int whitespaceRangeStart) Creates a DefaultCharAppender with a maximum limit of characters to append and the default value to return when no characters have been accumulated. The padding character is defaulted to a whitespace character ' '.
| |
| append | back to summary |
|---|---|
| public void append(char ch) Implements com. Doc from com. Appends the given character.
| |
| append | back to summary |
|---|---|
| public final void append(Object o) Implements com. Doc from com. Appends the | |
| append | back to summary |
|---|---|
| public final void append(int ch) Implements com. Doc from com. Appends the given codepoint.
| |
| append | back to summary |
|---|---|
| public final void append(int[] ch) Implements com. Doc from com. Appends codepoints from an input array
| |
| append | back to summary |
|---|---|
| public void append(DefaultCharAppender appender) Appends the contents of another DefaultCharAppender, discarding any of its trailing whitespace characters
| |
| append | back to summary |
|---|---|
| public void append(char[] ch, int from, int length) Implements com. Doc from com. Appends characters from an input array
| |
| append | back to summary |
|---|---|
| public final void append(char[] ch) Implements com. Doc from com. Appends characters from an input array
| |
| append | back to summary |
|---|---|
| public void append(String string, int from, int to) Implements com. Doc from com. Appends the contents of a String to this appender
| |
| append | back to summary |
|---|---|
| public final void append(String string) Implements com. Doc from com. Appends characters from an input | |
| appendIgnoringPadding | back to summary |
|---|---|
| public void appendIgnoringPadding(char ch, char padding) Implements com. Doc from com. Appends the given character and marks it as ignored if it is a padding character (the definition of a padding character is implementation dependent.)
| |
| appendIgnoringWhitespace | back to summary |
|---|---|
| public void appendIgnoringWhitespace(char ch) Implements com. Doc from com. Appends the given character and marks it as ignored if it is a whitespace (
| |
| appendIgnoringWhitespaceAndPadding | back to summary |
|---|---|
| public void appendIgnoringWhitespaceAndPadding(char ch, char padding) Implements com. Doc from com. Appends the given character and marks it as ignored if it is a whitespace (
| |
| appendUntil | back to summary |
|---|---|
| public char appendUntil(char ch, CharInput input, char stop) Implements com. Doc from com. Appends characters from the input, until a stop character is found
| |
| appendUntil | back to summary |
|---|---|
| public char appendUntil(char ch, CharInput input, char stop1, char stop2) Implements com. Doc from com. Appends characters from the input, until a stop character is found
| |
| appendUntil | back to summary |
|---|---|
| public char appendUntil(char ch, CharInput input, char stop1, char stop2, char stop3) Implements com. Doc from com. Appends characters from the input, until a stop character is found
| |
| charAt | back to summary |
|---|---|
| public final char charAt(int i) Implements java. Doc from java. Returns the If the
| |
| delete | back to summary |
|---|---|
| public void delete(int count) Implements com. Doc from com. Deletes a given number of characters from the end of the appended content.
Will reset the internal whitespace count if any. Invoke
| |
| fill | back to summary |
|---|---|
| public void fill(char ch, int length) Implements com. Doc from com. Adds a sequence of repeated characters to the input.
| |
| getAndReset | back to summary |
|---|---|
| public String getAndReset() Implements com. Returns the accumulated value as a String, discarding any trailing whitespace characters identified when using The internal accumulated value is discarded after invoking this method (as in If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be
| |
| getChars | back to summary |
|---|---|
| public final char[] getChars() Implements com. Doc from com. Returns the internal character array.
| |
| getCharsAndReset | back to summary |
|---|---|
| public char[] getCharsAndReset() Implements com. Returns the accumulated characters, discarding any trailing whitespace characters identified when using The internal accumulated value is discarded after invoking this method (as in If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be character sequence of the
| |
| ignore | back to summary |
|---|---|
| public final void ignore(int count) Implements com. Doc from com. Ignores the given number of characters at the end of the appended content,
effectively marking these as whitespace. Invoking
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(char ch, int from) Implements com. Doc from com. Returns first the position of a given character
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(char[] charSequence, int fromIndex) Implements com. Doc from com. Returns first the position of a given character sequence
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(CharSequence charSequence, int fromIndex) Implements com. Doc from com. Returns first the position of a given character sequence
| |
| indexOfAny | back to summary |
|---|---|
| public int indexOfAny(char[] chars, int from) Implements com. Doc from com. Returns the first position of any given character
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements com. Doc from com. Indicates whether this appender represents an empty
| |
| lastIndexOf | back to summary |
|---|---|
| public int lastIndexOf(char ch) Implements com. Doc from com. Returns the last index of a given character in the current appended (characters that have been marked as whitespace will be ignored)
| |
| length | back to summary |
|---|---|
| public final int length() Implements com. Doc from com. Returns the current accumulated value length (the sum of all appended characters - whitespaceCount).
| |
| prepend | back to summary |
|---|---|
| public void prepend(char ch) Implements com. Prepends the current accumulated value with a character
| |
| prepend | back to summary |
|---|---|
| public void prepend(char ch1, char ch2) Implements com. Doc from com. Prepends the current accumulated value with a couple of characters
| |
| prepend | back to summary |
|---|---|
| public void prepend(char[] chars) Implements com. Doc from com. Prepends the current accumulated value a sequence of characters
| |
| remove | back to summary |
|---|---|
| public void remove(int from, int length) Implements com. Doc from com. Removes a section from the appended content
| |
| reset | back to summary |
|---|---|
| public void reset() Implements com. Doc from com. Clears the accumulated value and the whitespace count.
| |
| resetWhitespaceCount | back to summary |
|---|---|
| public final void resetWhitespaceCount() Implements com. Doc from com. Resets the number of whitespaces accumulated after the last non-whitespace character. This is the number of whitespaces accumulated using A subsequent call to
| |
| subSequence | back to summary |
|---|---|
| public final String subSequence(int from, int to) Implements java. Doc from java. Returns a | |
| substring | back to summary |
|---|---|
| public String substring(int from, int length) Implements com. Doc from com. Returns a section of the appended content | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Implements java. Returns the accumulated value as a String, discarding any trailing whitespace characters identified when using Does not discard the accumulated value. If the accumulated value is empty (i.e. no characters were appended, or all appended characters where ignored as whitespace or padding), then the return value will be
| |
| updateWhitespace | back to summary |
|---|---|
| public final void updateWhitespace() Implements com. Updates the internal whitespace count of this appender to trim trailing whitespaces. | |
| whitespaceCount | back to summary |
|---|---|
| public final int whitespaceCount() Implements com. Doc from com. Returns the current number of whitespaces accumulated after the last non-whitespace character. This is the number of whitespaces accumulated using
| |