de.jstacs.io
Class SparseStringExtractor
java.lang.Object
de.jstacs.io.AbstractStringExtractor
de.jstacs.io.SparseStringExtractor
- All Implemented Interfaces:
- Enumeration<String>
public class SparseStringExtractor
- extends AbstractStringExtractor
This StringExtractor reads the Strings from a File as the user asks
for the String. Instances of this class are sparse since they do not store an
array of Strings internally.
- Author:
- Jens Keilwagen
SparseStringExtractor
public SparseStringExtractor(File file)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file.
- Parameters:
file - the file to be read from
- Throws:
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
SparseStringExtractor
public SparseStringExtractor(File file,
char ignore)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file and ignores
those starting with ignore.
- Parameters:
file - the file to be read fromignore - the first character of lines that should be treated as
comments
- Throws:
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
SparseStringExtractor
public SparseStringExtractor(File file,
String annotation)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file .
- Parameters:
file - the file to be read fromannotation - the annotation for the source
- Throws:
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
SparseStringExtractor
public SparseStringExtractor(File file,
char ignore,
String annotation)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file and ignores
those starting with ignore.
- Parameters:
file - the file to be read fromignore - the first character of lines that should be treated as
commentsannotation - the annotation for the source
- Throws:
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
hasMoreElements
public boolean hasMoreElements()
nextElement
public String nextElement()
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize in class Object
- Throws:
Throwable