Package org.apache.commons.io.input
Class AbstractCharacterFilterReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- org.apache.commons.io.input.AbstractCharacterFilterReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
- Direct Known Subclasses:
CharacterFilterReader
,CharacterSetFilterReader
public abstract class AbstractCharacterFilterReader extends java.io.FilterReader
A filter reader that filters out characters where subclasses decide which characters to filter out.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCharacterFilterReader(java.io.Reader reader)
Constructs a new reader.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
filter(int ch)
Returns true if the given character should be filtered out, false to keep the character.int
read()
int
read(char[] cbuf, int off, int len)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.FilterReader
- Throws:
java.io.IOException
-
filter
protected abstract boolean filter(int ch)
Returns true if the given character should be filtered out, false to keep the character.- Parameters:
ch
- the character to test.- Returns:
- true if the given character should be filtered out, false to keep the character.
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterReader
- Throws:
java.io.IOException
-
-