Class Recognizer

java.lang.Object
chemaxon.formats.Recognizer

@PublicApi public abstract class Recognizer extends Object
File format recognizer.
Since:
Marvin 5.0, 06/07/2007
  • Field Details

    • needsMore

      protected boolean needsMore
  • Constructor Details

    • Recognizer

      public Recognizer()
  • Method Details

    • needsMore

      public boolean needsMore()
      Should we read more lines?
      Returns:
      true if more lines are needed, false otherwise
    • isLastLine

      public boolean isLastLine()
      Tests whether it is the last line of file.
      Returns:
      true if it is the last line, false otherwise
    • setLastLine

      public void setLastLine()
      Sets last line flag.
    • guessFormat

      public String guessFormat(String line)
      Tries to guess the format of the given line. It is useful for single line formats.
      Parameters:
      line - the line
      Returns:
      the name of the most likely format, that this recognizer can recognize, or null the format could not be decided
    • tryToRecognize

      public abstract Recognizer.RecognizerResult tryToRecognize(String line, int lineNumber)
      Checks whether the parameter line can be part of a valid (format-specified) file on the given file position.
      Parameters:
      line - the line string
      lineNumber - the position of the line
      Returns:
      the recognizer result object