Package eu.bandm.tools.util.files
Class StreamsReadersWriters.CaseChangeReader
java.lang.Object
java.io.Reader
java.io.FilterReader
eu.bandm.tools.util.files.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
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchar
changeCase
(char c) Do the change of the character case, according to the value intoUpper
.int
read()
int
read
(char[] buf, int off, int len) Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
Methods 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:
read
in classFilterReader
- Throws:
IOException
-
read
- Overrides:
read
in 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.
-