Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.io
Class StringExtractor

    java.lang.Object
      de.jstacs.io.AbstractStringExtractor
          de.jstacs.io.StringExtractor

All Implemented Interfaces:
  Enumeration<String>

    public class StringExtractor

extends AbstractStringExtractor

This class implements the reader that extracts `String`s from either a `File` or a `String`. Internally the `String`s are extracted and stored in an array when creating a new instance.

Author:
  Jan Grau, Jens Keilwagen

Field Summary

Fields inherited from class de.jstacs.io.AbstractStringExtractor
`annotation, FASTA, ignore, ignorePattern, USUALLY`

Constructor Summary
`StringExtractor(File file, int initSize)` A constructor that reads the lines from `file`.
`StringExtractor(File file, int initSize, char ignore)` A constructor that reads the lines from `file` and ignores those starting with the comment character `ignore`.
`StringExtractor(File file, int initSize, 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`.
`StringExtractor(File file, int initSize, String annotation)` A constructor that reads the lines from `file` and sets the annotation of the source to `annotation`.
`StringExtractor(String content, int initSize, char ignore, String annotation)` A constructor that reads the lines from a `String` `content`, ignores those starting with the comment character `ignore` and sets the annotation of the source to `annotation`.
`StringExtractor(String content, int initSize, String annotation)` A constructor that reads the lines from a `String` `content` and sets the annotation of the source to `annotation`.

Method Summary
`String` | `getElement(int idx)` Returns `String` number `idx` that has been extracted.
`int` | `getNumberOfElements()` Returns the number of `String`s that have been read.
`boolean` | `hasMoreElements()`
`String` | `nextElement()`

Methods inherited from class de.jstacs.io.AbstractStringExtractor
`getAnnotation`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StringExtractor

    public StringExtractor(File file,
                           int initSize)
                    throws IOException,
                           FileNotFoundException

  A constructor that reads the lines from `file`.

  Parameters:
    `file` - the `File` to be read from
    `initSize` - the initial number of lines that can be handled
  Throws:
    `IOException` - if the `File` could not be read
    `FileNotFoundException` - if the `File` could not be found
  See Also:
    `StringExtractor(File, int, char)`

### StringExtractor

    public StringExtractor(File file,
                           int initSize,
                           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 from
    `initSize` - the initial number of lines that can be handled
    `ignore` - 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:
    `StringExtractor(File, int, char, String)`

### StringExtractor

    public StringExtractor(File file,
                           int initSize,
                           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 from
    `initSize` - the initial number of lines that can be handled
    `annotation` - the annotation for the source
  Throws:
    `IOException` - if the `File` could not be read
    `FileNotFoundException` - if the `File` could not be found
  See Also:
    `StringExtractor(File, int, char, String)`

### StringExtractor

    public StringExtractor(File file,
                           int initSize,
                           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 from
    `initSize` - the initial number of lines that can be handled
    `ignore` - the first character of lines that should be treated as comments
    `annotation` - the annotation for the source
  Throws:
    `IOException` - if the `File` could not be read
    `FileNotFoundException` - if the `File` could not be found

### StringExtractor

    public StringExtractor(String content,
                           int initSize,
                           String annotation)

  A constructor that reads the lines from a `String` `content` and sets the annotation of the source to `annotation`.

  Parameters:
    `content` - the complete `String` with all lines
    `initSize` - the initial number of lines that can be handled
    `annotation` - some annotation for the content
  See Also:
    `StringExtractor(String, int, char, String)`

### StringExtractor

    public StringExtractor(String content,
                           int initSize,
                           char ignore,
                           String annotation)

  A constructor that reads the lines from a `String` `content`, ignores those starting with the comment character `ignore` and sets the annotation of the source to `annotation`.

  Parameters:
    `content` - the complete `String` with all lines
    `initSize` - the initial number of lines that can be handled
    `ignore` - the first character of lines that should be treated as comments
    `annotation` - some annotation for the content

Method Detail

### nextElement

    public String nextElement()

### hasMoreElements

    public boolean hasMoreElements()

### getNumberOfElements

    public int getNumberOfElements()

  Returns the number of `String`s that have been read.

  Returns:
    the number of `String`s that have been read

### getElement

    public String getElement(int idx)

  Returns `String` number `idx` that has been extracted.

  Parameters:
    `idx` - the number of the `String`
  Returns:
    `String` number `idx`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD