gnu.regexp
Class REFilterReader
java.lang.Object
java.io.Reader
java.io.FilterReader
gnu.regexp.REFilterReader
- All Implemented Interfaces:
- Closeable, Readable
public class REFilterReader
- extends FilterReader
Replaces instances of a given RE with replacement text.
- Since:
- gnu.regexp 1.1.0
- Author:
- Lee Sau Dan
|
Method Summary |
boolean |
markSupported()
Returns false. |
int |
read()
Reads the next byte from the stream per the general contract of
Reader.read(). |
int |
read(byte[] b)
Reads from the stream into the provided array. |
int |
read(byte[] b,
int off,
int len)
Reads from the stream into the provided array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REFilterReader
public REFilterReader(Reader f_stream,
RE f_expr,
String f_replace)
- Creates an REFilterReader. When reading from this stream,
occurrences of patterns matching the supplied regular expression
will be replaced with the supplied replacement text (the
metacharacters $0 through $9 may be used to refer to the full
match or subexpression matches.
- Parameters:
f_stream - The Reader to be filtered.f_expr - The regular expression to search for.f_replace - The text pattern to replace matches with.
read
public int read()
- Reads the next byte from the stream per the general contract of
Reader.read(). Returns -1 on error or end of stream.
- Overrides:
read in class FilterReader
markSupported
public boolean markSupported()
- Returns false. REFilterReader does not support mark() and
reset() methods.
- Overrides:
markSupported in class FilterReader
read
public int read(byte[] b,
int off,
int len)
- Reads from the stream into the provided array.
read
public int read(byte[] b)
- Reads from the stream into the provided array.
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.