Package chemaxon.marvin.io
Class MRecord
java.lang.Object
chemaxon.marvin.io.MRecord
Record in a multi-molecule file.
- Since:
- Marvin 5.0, 04/06/2006
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Molecule (or reaction) is missing from the record.protected long
protected long
protected MPropertyContainer
-
Constructor Summary
ConstructorDescriptionMRecord()
Default constructor.MRecord
(long start, long end, int lineno, String s, MPropertyContainer p, int[] lmap) Creates a record.MRecord
(long start, long end, int lineno, String s, MPropertyContainer p, int[] lmap, int descflags) Creates a record.MRecord
(long start, long end, int lineno, String s, MPropertyContainer p, int[] lmap, int descflags, String moleculeName) Creates a record. -
Method Summary
Modifier and TypeMethodDescriptionGets the encoding.int
Gets the line number at the ending point.long
Gets the end position in the input file.int
getFlags()
Gets the record descriptor flags.Gets the full format string of the record.int
Gets the number of new lines in the molecule header part.Gets the input format.int[]
Gets the line number to original line number mapping.byte[]
Gets the molecule bytes, with preprended header and appended footer if appropriate.Returns the name of the molecule in the record.Gets the molecule string, with preprended header and appended footer if appropriate.Gets the properties.int
Gets the line number at the starting point.long
Gets the start position in the input file.Gets the record text as string.void
setMolBytes
(byte[] molBytes) Sets the molecule bytes.void
setMolString
(String molstr)
-
Field Details
-
F_MOL_MISSING
public static final int F_MOL_MISSINGMolecule (or reaction) is missing from the record. This record descriptor flag is set if the molecule part of the record contains only a registry number ("MIREG", "MEREG", "RIREG" or "REREG") in case of an RDfile.- Since:
- Marvin 5.0.3, 03/20/2008
- See Also:
-
fileStartPosition
protected long fileStartPosition -
fileEndPosition
protected long fileEndPosition -
properties
-
-
Constructor Details
-
MRecord
public MRecord()Default constructor.- Since:
- Marvin 5.2
-
MRecord
Creates a record.- Parameters:
start
- the start position in input fileend
- the end position in input filelineno
- the line number at the starting points
- the record stringp
- the propertieslmap
- original line numbers
-
MRecord
public MRecord(long start, long end, int lineno, String s, MPropertyContainer p, int[] lmap, int descflags) Creates a record.- Parameters:
start
- the start position in input fileend
- the end position in input filelineno
- the line number at the starting points
- the record stringp
- the propertieslmap
- original line numbersdescflags
- extra record descriptor flags
-
MRecord
public MRecord(long start, long end, int lineno, String s, MPropertyContainer p, int[] lmap, int descflags, String moleculeName) Creates a record.- Parameters:
start
- the start position in input fileend
- the end position in input filelineno
- the line number at the starting points
- the record stringp
- the propertieslmap
- original line numbersdescflags
- extra record descriptor flagsmoleculeName
- name of the molecule- Since:
- Marvin 5.0.3, 03/20/2008
-
-
Method Details
-
getEncoding
Gets the encoding.- Returns:
- the encoding
- Since:
- Marvin 5.3
-
setMolString
-
getMolString
Gets the molecule string, with preprended header and appended footer if appropriate. This string can be imported to get a valid molecule.- Returns:
- the molecule string
- Since:
- Marvin 5.3
-
setMolBytes
public void setMolBytes(byte[] molBytes) Sets the molecule bytes. Used for binary formats, otherwisesetMolString(java.lang.String)
is called to set the mol string.- Parameters:
molBytes
- the molecule bytes
-
getMolBytes
public byte[] getMolBytes()Gets the molecule bytes, with preprended header and appended footer if appropriate. This byte array can be imported to get a valid molecule. Only used for binary formats, otherwise callgetMolString()
.- Returns:
- the molecule string
- Since:
- Marvin 5.4
-
getHeaderNewLineCount
public int getHeaderNewLineCount()Gets the number of new lines in the molecule header part.- Returns:
- the number of new lines in the molecule header part
- Since:
- Marvin 5.3
-
getFormat
Gets the full format string of the record. E.g. for a gzipped mrv it returns "gzip:mrv".- Returns:
- the format of the record as a string.
-
getInputFormat
Gets the input format. This the format of the file. E.g for a gzipped mrv it returns "mrv"- Returns:
- the input format
- Since:
- Marvin 5.3
-
getString
Gets the record text as string. Note that the returned string is not guaranteed to be a valid molecule file. Prepend the molecule file header and append the footer to get an importable file.- Returns:
- the text
- See Also:
-
getPropertyContainer
Gets the properties.- Returns:
- the properties
-
getLineNumberMap
public int[] getLineNumberMap()Gets the line number to original line number mapping.- Returns:
- the mapping
-
getStartPosition
public long getStartPosition()Gets the start position in the input file.- Returns:
- the position
-
getEndPosition
public long getEndPosition()Gets the end position in the input file.- Returns:
- the position
-
getStartLineCount
public int getStartLineCount()Gets the line number at the starting point.- Returns:
- the line number
-
getEndLineCount
public int getEndLineCount()Gets the line number at the ending point.- Returns:
- the line number
- Since:
- Marvin 5.3
-
getFlags
public int getFlags()Gets the record descriptor flags.- Returns:
- the record descriptor flags
- Since:
- Marvin 5.0.3, 03/20/2008
- See Also:
-
getMoleculeName
Returns the name of the molecule in the record.- Returns:
- the name or an empty string if it's not specified
- Since:
- Marvin 6.3
-