Package chemaxon.formats.recognizer
Class Recognizer
java.lang.Object
chemaxon.formats.recognizer.Recognizer
- Direct Known Subclasses:
AbbrevGroupRecognizer,PDBRecognizer,PeptideRecognizer,SMILESRecognizer,chemaxon.formats.recognizer.XYZRecognizer
File format recognizer.
- Since:
- Marvin 5.0, 06/07/2007
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 not usedguessFormat(String line) Tries to guess the format of the given line.booleanTests whether it is the last line of file.booleanShould we read more lines?chemaxon.common.util.Pair<Boolean, Collection<String>> tryToRecognize(String line, int lineNumber) Checks whether the parameter line can be part of a valid (format specified) file on the given file position.voidtryToRecognize(String line, int linenum, RecognizerList reclist) Deprecated, for removal: This API element is subject to removal in a future version.Not used in recognition and will be removed.
-
Field Details
-
needsMore
protected boolean needsMore
-
-
Constructor Details
-
Recognizer
public Recognizer()
-
-
Method Details
-
tryToRecognize
@SubjectToRemoval(date=JUL_01_2025) @Deprecated(forRemoval=true) public void tryToRecognize(String line, int linenum, RecognizerList reclist) Deprecated, for removal: This API element is subject to removal in a future version.Not used in recognition and will be removed. ImplementtryToRecognize(String, int)instead.Tries to recognize a line. If a format becomes impossible, then it is removed from the set of possible formats.- Parameters:
line- the linelinenum- the line numberreclist- the list of possible formats
-
needsMore
public boolean needsMore()Should we read more lines?- Returns:
trueif more lines are needed,falseotherwise
-
getLastProcessedLineNum
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public int getLastProcessedLineNum()Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 not usedGets 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:
trueif it is the last line,falseotherwise
-
guessFormat
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 chemaxon.common.util.Pair<Boolean,Collection<String>> 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 stringlineNumber- the position of the line- Returns:
- a
Pairof which second parameter gives the format name collection that is:- Recognized to be excluded if the first parameter is false
- Positively recognized if the first parameter is true
-