public class CharacterSetFilterReader extends AbstractCharacterFilterReader
int code points, handy to remove
known junk characters from CSV files for example.
This class must convert each int read to an Integer. You can increase the Integer cache
with a system property, see Integer.
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Set<java.lang.Integer> |
EMPTY_SET |
private java.util.Set<java.lang.Integer> |
skipSet |
| Constructor and Description |
|---|
CharacterSetFilterReader(java.io.Reader reader,
java.util.Set<java.lang.Integer> skip)
Constructs a new reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
filter(int ch)
Returns true if the given character should be filtered out, false to keep the character.
|
read, readprivate static final java.util.Set<java.lang.Integer> EMPTY_SET
private final java.util.Set<java.lang.Integer> skipSet
public CharacterSetFilterReader(java.io.Reader reader,
java.util.Set<java.lang.Integer> skip)
reader - the reader to filter.skip - the set of characters to filter out.protected boolean filter(int ch)
AbstractCharacterFilterReaderfilter in class AbstractCharacterFilterReaderch - the character to test.