gov.nih.nlm.umls.io
Class SearchStringPushBackReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
gov.nih.nlm.umls.io.PushBackReader
gov.nih.nlm.umls.io.SearchStringPushBackReader
- public class SearchStringPushBackReader
- extends PushBackReader
Extends PushBackReader
to provide the ability to
find a single line of input, given a search string or pattern,
and to push it back onto the reader to read it again
on the next readLine()
call.
- Author:
- Brian Carlsen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
char_set
protected String char_set
raf
protected RandomAccessFile raf
search_pattern
protected String search_pattern
SearchStringPushBackReader
public SearchStringPushBackReader(File file,
String search_str)
throws IOException,
FileNotFoundException
- Instantiates a new
SearchStringPushBackReader
from
the specified file and search pattern.
- Parameters:
file
- the File
to open and search insearch_str
- the search pattern
- Throws:
IOException
FileNotFoundException
SearchStringPushBackReader
public SearchStringPushBackReader(RandomAccessFile raf,
String search_str)
throws IOException,
FileNotFoundException
- Instantiates a new
SearchStringPushBackReader
from
the specified file and search pattern.
- Parameters:
raf
- the RandomAccessFile
to search insearch_str
- the search pattern
- Throws:
IOException
FileNotFoundException
readLine
public String readLine()
throws IOException
- Returns the next line from the reader.
- Overrides:
readLine
in class PushBackReader
- Returns:
- the next line from the reader
- Throws:
IOException
setCharSet
public void setCharSet(String char_set)
- Sets the character set to the given parameter.
- Parameters:
char_set
- character set parameter such as "UTF-8"
close
public void close()
throws IOException
- Close the
SearchStringPushBackReader
.
- Throws:
IOException
Copyright ©2005