Package eu.bandm.tools.util
Class StreamsReadersWriters.CaseChangeReader
java.lang.Object
java.io.Reader
java.io.FilterReader
eu.bandm.tools.util.StreamsReadersWriters.CaseChangeReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
- Enclosing class:
- StreamsReadersWriters
Converts all characters read to lower or to upper.
Uses methods from
Character, thus ist is not localized.
Does not treat supplementary characters
(two Java-characters corresponding to one Unicode codepoint above 0x1_0000).-
Field Summary
FieldsFields inherited from class java.io.FilterReader
in -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharchangeCase(char c) Do the change of the character case, according to the value intoUpper.intread()intread(char[] buf, int off, int len) Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skipMethods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Field Details
-
toUpper
final boolean toUpper
-
-
Constructor Details
-
CaseChangeReader
Only Constructor.- Parameters:
in- the predecessor in the filter chain = the Reader from which the data comes.toUpper- indicates whether convert to upper case, not to lower case.
-
-
Method Details
-
read
- Overrides:
readin classFilterReader- Throws:
IOException
-
read
- Overrides:
readin classFilterReader- Throws:
IOException
-
changeCase
public char changeCase(char c) Do the change of the character case, according to the value intoUpper. Is calles for every character read from the input. Is public to be overridden by the user in case that more sophisticated character conversion is necessary.
-