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 String
s from a File
as
the user asks for the String
. Instances of this class are sparse
since they do not store an array of String
s internally.
- Author:
- Jens Keilwagen
Constructor Summary |
SparseStringExtractor(File file)
A constructor that reads the lines from file . |
SparseStringExtractor(File file,
char ignore)
A constructor that reads the lines from file and ignores
those starting with the comment character ignore . |
SparseStringExtractor(File file,
char ignore,
String annotation)
A constructor that reads the lines from file , ignores those
starting with the comment character ignore and sets the
annotation of the source to annotation . |
SparseStringExtractor(File file,
String annotation)
A constructor that reads the lines from file and sets the
annotation of the source to annotation . |
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
- if the File
could not be read
FileNotFoundException
- if the File
could not be found- See Also:
SparseStringExtractor(File, char)
SparseStringExtractor
public SparseStringExtractor(File file,
char ignore)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file
and ignores
those starting with the comment character ignore
.
- Parameters:
file
- the File
to be read fromignore
- the first character of lines that should be treated as
comments
- Throws:
IOException
- if the File
could not be read
FileNotFoundException
- if the File
could not be found- See Also:
SparseStringExtractor(File, char, String)
SparseStringExtractor
public SparseStringExtractor(File file,
String annotation)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file
and sets the
annotation of the source to annotation
.
- Parameters:
file
- the File
to be read fromannotation
- the annotation for the source
- Throws:
IOException
- if the File
could not be read
FileNotFoundException
- if the File
could not be found- See Also:
SparseStringExtractor(File, char, String)
SparseStringExtractor
public SparseStringExtractor(File file,
char ignore,
String annotation)
throws IOException,
FileNotFoundException
- A constructor that reads the lines from
file
, ignores those
starting with the comment character ignore
and sets the
annotation of the source to annotation
.
- 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
- if the File
could not be read
FileNotFoundException
- if the File
could not be found- See Also:
AbstractStringExtractor.AbstractStringExtractor(char)
hasMoreElements
public boolean hasMoreElements()
nextElement
public String nextElement()
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize
in class Object
- Throws:
Throwable