Package chemaxon.formats
Class Recognizer
java.lang.Object
chemaxon.formats.Recognizer
File format recognizer.
- Since:
- Marvin 5.0, 06/07/2007
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents the result of a format recognition attempt. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionguessFormat(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?voidSets last line flag.abstract Recognizer.RecognizerResulttryToRecognize(String line, int lineNumber) Checks whether the parameter line can be part of a valid (format-specified) file on the given file position.
-
Field Details
-
needsMore
protected boolean needsMore
-
-
Constructor Details
-
Recognizer
public Recognizer()
-
-
Method Details
-
needsMore
public boolean needsMore()Should we read more lines?- Returns:
trueif more lines are needed,falseotherwise
-
isLastLine
public boolean isLastLine()Tests whether it is the last line of file.- Returns:
trueif it is the last line,falseotherwise
-
setLastLine
public void setLastLine()Sets last line flag. -
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
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:
- the recognizer result object
-