chemaxon.formats.recognizer
Class Recognizer

java.lang.Object
  extended by chemaxon.formats.recognizer.Recognizer
Direct Known Subclasses:
AbbrevGroupRecognizer, Base64Recognizer, ChimeRecognizer, JTFRecognizer, PDBRecognizer, PeptideRecognizer, SMILESRecognizer, chemaxon.formats.recognizer.XYZRecognizer

public abstract class Recognizer
extends Object

File format recognizer.

Since:
Marvin 5.0, 06/07/2007
Version:
5.0, 10/15/2007
Author:
Peter Csizmadia

Constructor Summary
Recognizer()
           
 
Method Summary
 int getLastProcessedLineNum()
          Gets the number of the last processed line.
 int getPriority()
          Deprecated. as of Marvin 5.1, use MFileFormat.getPriority(java.lang.String) instead
 boolean isLastLine()
          Tests whether it is the last line of file.
abstract  boolean needsMore()
          Should we read more lines?
abstract  void tryToRecognize(String line, int linenum, RecognizerList reclist)
          Tries to recognize a line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recognizer

public Recognizer()
Method Detail

tryToRecognize

public abstract void tryToRecognize(String line,
                                    int linenum,
                                    RecognizerList reclist)
Tries to recognize a line. If a format becomes impossible, then it is removed from the set of possible formats.

Parameters:
line - the line
linenum - the line number
reclist - the list of possible formats

needsMore

public abstract boolean needsMore()
Should we read more lines?

Returns:
true if more lines are needed, false otherwise

getPriority

@Deprecated
public int getPriority()
Deprecated. as of Marvin 5.1, use MFileFormat.getPriority(java.lang.String) instead


getLastProcessedLineNum

public int getLastProcessedLineNum()
Gets the number of the last processed line.

Returns:
the line number

isLastLine

public boolean isLastLine()
Tests whether it is the last line of file.

Returns:
true if it is the last line, false otherwise