Class DatasetParser

java.lang.Object
pt.ist.phylolib.data.dataset.DatasetParser
All Implemented Interfaces:
IReader<Dataset>
Direct Known Subclasses:
FASTA, ML, SNP

public abstract class DatasetParser extends Object implements IReader<Dataset>
Responsible for parsing phylogenetic datasets from Strings.
  • Constructor Details

    • DatasetParser

      public DatasetParser()
  • Method Details

    • parse

      public Dataset parse(Stream<String> data, Options options)
      Description copied from interface: IReader
      Parses the input data into an object.
      Specified by:
      parse in interface IReader<Dataset>
      Parameters:
      data - the input data to parse
      Returns:
      the object resultant from parsing the input data
    • init

      protected void init(Iterator<String> iterator)
      Initializes the state of the processor by parsing the first lines of the dataset.

      By default, does not parse anything.

      Parameters:
      iterator - the iterator containing the lines of the dataset
    • parse

      protected abstract Profile parse(Iterator<String> iterator)
      Parses one profile from the given Strings.
      Parameters:
      iterator - the iterator containing the lines of the dataset
      Returns:
      a new profile resultant from parsing lines of the dataset