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 java.lang.Object
implements IReader<Dataset>
Responsible for parsing phylogenetic datasets from Strings.
  • Field Summary

    Fields inherited from interface pt.ist.phylolib.data.IReader

    FAILED, FINISHED, READ, STARTED
  • Constructor Summary

    Constructors 
    Constructor Description
    DatasetParser()  
  • Method Summary

    Modifier and Type Method Description
    protected void init​(java.util.Iterator<java.lang.String> iterator)
    Initializes the state of the processor by parsing the first lines of the dataset.
    protected abstract Profile parse​(java.util.Iterator<java.lang.String> iterator)
    Parses one profile from the given Strings.
    Dataset parse​(java.util.stream.Stream<java.lang.String> data)
    Parses the input data into an object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • parse

      public Dataset parse​(java.util.stream.Stream<java.lang.String> data)
      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​(java.util.Iterator<java.lang.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​(java.util.Iterator<java.lang.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