de.jstacs.io
Class SparseStringExtractor

java.lang.Object
  extended by de.jstacs.io.AbstractStringExtractor
      extended by 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

Field Summary
 
Fields inherited from class de.jstacs.io.AbstractStringExtractor
annotation, FASTA, ignore, ignorePattern, USUALLY
 
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 ignore.
SparseStringExtractor(File file, char ignore, String annotation)
          A constructor that reads the lines from file and ignores those starting with ignore.
SparseStringExtractor(File file, String annotation)
          A constructor that reads the lines from file .
 
Method Summary
protected  void finalize()
           
 boolean hasMoreElements()
           
 String nextElement()
           
 
Methods inherited from class de.jstacs.io.AbstractStringExtractor
getAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 from
ignore - 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 from
annotation - 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 from
ignore - the first character of lines that should be treated as comments
annotation - 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
Method Detail

hasMoreElements

public boolean hasMoreElements()

nextElement

public String nextElement()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable