Package chemaxon.formats
Class MFileFormat
- java.lang.Object
-
- chemaxon.formats.MFileFormat
-
@PublicAPI public class MFileFormat extends Object
File format descriptor class.- Since:
- Marvin 5.0, 05/23/2007
-
-
Field Summary
Fields Modifier and Type Field Description static MFileFormat
ABBREVGROUP
Chemaxon SMILES Abbreviated Groups.static MFileFormat
ACCORD
ACCORD file formatstatic MFileFormat
AWT_IMAGE
Image object (java.awt.Image).static MFileFormat
BASE64
BASE64 encoded file.static MFileFormat
CDX
ChemDraw CDX file.static MFileFormat
CDXML
ChemDraw CDXML file.static MFileFormat
CML
Chemical Markup Language.static MFileFormat
CSMDL_IN
Chemaxon Compressed Molfiles, RGfiles, Rgfiles, SDfiles or RDfiles.static MFileFormat
CSMOL_OUT
Chemaxon Compressed Molfiles and Rgfiles.static MFileFormat
CSRDF
Chemaxon Compressed RDfiles.static MFileFormat
CSRXN_OUT
Chemaxon Compressed Rxnfiles.static MFileFormat
CSSDF_OUT
Chemaxon Compressed SDfiles.static MFileFormat
CSV
static MFileFormat
CXON
Chemaxon Object Notation.static MFileFormat
CXSMARTS
Chemaxon Extended SMARTS.static MFileFormat
CXSMILES
Chemaxon Extended SMILES.static MFileFormat
D2S
Any document format recognized by Document to Structure (doc, odt, ...).static MFileFormat
DNA
DNA sequence.static MFileFormat
EMF
Windows Enhanced Metafiles.static MFileFormat
EPS
Encapsulated PostScript vector image format.static long
F_ARCHIVE
General archive format that stores a file in another format.static long
F_BINARY
Import/export module handles binary (byte array) data.static long
F_COORDS
The format can store atom coordinates if this flag is set.static long
F_EXPORT
Export is possible if this flag is set.static long
F_GRAPHICS
File format readable by a graphics program (image viewer, ray tracer etc.).static long
F_IMAGE
2D image file format, readable by image viewers.static long
F_IMPORT
Import is possible if this flag is set.static long
F_MIXED
Storage of records in different formats is possible if this flag is set.static long
F_MOLECULE
The format can store molecule(s) if this flag is set.static long
F_MULTIPLE_RECORDS_LEGAL
The format is designed to store multiple records if this flag is set.static long
F_MULTIPLE_RECORDS_POSSIBLE
The import/export modules can handle files with multiple records if this flag is set, but according to the format definition it is not legal.static long
F_OBJECT
Import/export module creates or reads a java object.static long
F_REACTION
The format can store reaction(s) if this flag is set.static long
F_RECOGNIZER
Format recognizer exists if this flag is set.static long
F_SINGLE_LINE
Format uses one line per structure.static long
F_USER_DEFINED
User defined format.static long
F_XML
The format is XML based if this flag is set.static MFileFormat
FASTA
FASTA file formatstatic MFileFormat
FASTA_DNA
FASTA file format with DNA sequencestatic MFileFormat
FASTA_PEPTIDE
FASTA file format with peptide sequencestatic MFileFormat
FASTA_RNA
FASTA file format with RNA sequencestatic MFileFormat
GAUSSIAN_CUBE
Gaussian Cube files.static MFileFormat
GAUSSIAN_INPUT
Gaussian Input Format.static MFileFormat
GAUSSIAN_INPUTZ
Gaussian Input Format: Z-matrix.static MFileFormat
GAUSSIAN_OUTPUT
Gaussian output format.static MFileFormat
GZIP
GZIPped file.static MFileFormat
INCHI
IUPAC InChI files.static MFileFormat
INCHIKEY
IUPAC InChIKey.static MFileFormat
JPEG
JPEG format.static MFileFormat
MOL
MDL Molfiles and Rgfiles.static MFileFormat
MOL_V2_OUT
static MFileFormat
MOL_V3_OUT
MDL Extended Molfiles and Rgfiles.static MFileFormat
MOL2
Tripos Mol2 files.static MFileFormat
MRV
Chemaxon Marvin Document.static MFileFormat
MSBMP
Windows Bitmap format.static MFileFormat
NAME
IUPAC Name files.static MFileFormat
OSRA
static MFileFormat
PDB
Protein Data Bank format.static MFileFormat
PDF
Portable Document Format.static MFileFormat
PEPTIDE_IN
Peptide Sequence.static MFileFormat
PEPTIDE1_OUT
Peptide Sequence (1-letter).static MFileFormat
PEPTIDE3_OUT
Peptide Sequence (3-letter).static MFileFormat
PNG
Portable Network Graphics.static MFileFormat
POVRAY
POVRay file.static MFileFormat
RDF
MDL RDfiles.static MFileFormat
RNA
RNA sequence.static MFileFormat
RXN
MDL Rxnfiles.static MFileFormat
RXN_V3_OUT
MDL Extended Rxnfiles.static MFileFormat
SDF
MDL SDfiles.static MFileFormat
SKC
SKC file formatstatic MFileFormat
SMARTS
SMARTS.static MFileFormat
SMILES
SMILES.static MFileFormat
SVG
Scalable Vector Graphics.static MFileFormat
SYBYLMOL
Tripos SYBYL molfiles.static MFileFormat
TIFF
Tagged Image File Format.static MFileFormat
VMN
static MFileFormat
XYZ
XYZ files.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MolExportModule
createExportModule()
Creates the export module.MolExportModule
createExportModule(String enc)
Creates the export module.MolImportModule
createImportModule()
Creates the molecule import module.Recognizer
createRecognizer()
Creates a recognizer module.Recognizer
createRecognizer(String fmt)
Deprecated.as of Marvin 2014.07.21.0 usecreateRecognizer()
insteadMRecordReader
createRecordReader(MolInputStream mis, String opts)
Creates the record reader.MFileFormat
getAssociatedNonQueryFormat()
Gets the associated non-query format.MFileFormat
getAssociatedQueryFormat()
Gets the associated query format.String
getDescription()
Gets the format description.String[]
getExtensions()
Gets the extension list.long
getFlags()
Gets the format descriptor flags.String
getMIMEType()
Deprecated.as of Marvin 2014.07.21.0 not usedString
getName()
Gets the codename of the format.String[]
getNames()
Gets all the codenames of the format.int
getPriority(String subfmt)
Deprecated.as of Marvin 2014.07.21.0 usegetSubFormatPriority(String)
insteadstatic int
getSubFormatPriority(String subFormatName)
Gets the priority of the specified subformat name.boolean
isFlagSet(long flag)
Checks whether the format has a given (set of) flag(s) set.boolean
matches(String fmt, long f, long mask)
Tests whether the format matches the specified pattern.String
toString()
Overrides Object.toString() to ease debugging.
-
-
-
Field Detail
-
MRV
public static final MFileFormat MRV
Chemaxon Marvin Document.
-
CML
public static final MFileFormat CML
Chemical Markup Language.
-
CXON
public static final MFileFormat CXON
Chemaxon Object Notation.
-
MOL
public static final MFileFormat MOL
MDL Molfiles and Rgfiles.
-
MOL_V2_OUT
public static final MFileFormat MOL_V2_OUT
-
MOL_V3_OUT
public static final MFileFormat MOL_V3_OUT
MDL Extended Molfiles and Rgfiles.
-
RXN
public static final MFileFormat RXN
MDL Rxnfiles.
-
RXN_V3_OUT
public static final MFileFormat RXN_V3_OUT
MDL Extended Rxnfiles.
-
SDF
public static final MFileFormat SDF
MDL SDfiles.
-
RDF
public static final MFileFormat RDF
MDL RDfiles.
-
CSMDL_IN
public static final MFileFormat CSMDL_IN
Chemaxon Compressed Molfiles, RGfiles, Rgfiles, SDfiles or RDfiles. Format object for import only.
-
CSMOL_OUT
public static final MFileFormat CSMOL_OUT
Chemaxon Compressed Molfiles and Rgfiles.
-
CSRXN_OUT
public static final MFileFormat CSRXN_OUT
Chemaxon Compressed Rxnfiles.
-
CSSDF_OUT
public static final MFileFormat CSSDF_OUT
Chemaxon Compressed SDfiles.
-
CSRDF
public static final MFileFormat CSRDF
Chemaxon Compressed RDfiles.
-
SMILES
public static final MFileFormat SMILES
SMILES.
-
SMARTS
public static final MFileFormat SMARTS
SMARTS.
-
CXSMILES
public static final MFileFormat CXSMILES
Chemaxon Extended SMILES.
-
CXSMARTS
public static final MFileFormat CXSMARTS
Chemaxon Extended SMARTS.
-
ABBREVGROUP
public static final MFileFormat ABBREVGROUP
Chemaxon SMILES Abbreviated Groups.
-
INCHI
public static final MFileFormat INCHI
IUPAC InChI files.
-
INCHIKEY
public static final MFileFormat INCHIKEY
IUPAC InChIKey.
-
NAME
public static final MFileFormat NAME
IUPAC Name files.
-
PEPTIDE_IN
public static final MFileFormat PEPTIDE_IN
Peptide Sequence.
-
PEPTIDE1_OUT
public static final MFileFormat PEPTIDE1_OUT
Peptide Sequence (1-letter).
-
PEPTIDE3_OUT
public static final MFileFormat PEPTIDE3_OUT
Peptide Sequence (3-letter).
-
RNA
public static final MFileFormat RNA
RNA sequence.
-
DNA
public static final MFileFormat DNA
DNA sequence.
-
XYZ
public static final MFileFormat XYZ
XYZ files.
-
GAUSSIAN_CUBE
public static final MFileFormat GAUSSIAN_CUBE
Gaussian Cube files.
-
GAUSSIAN_INPUT
public static final MFileFormat GAUSSIAN_INPUT
Gaussian Input Format.
-
GAUSSIAN_INPUTZ
public static final MFileFormat GAUSSIAN_INPUTZ
Gaussian Input Format: Z-matrix.
-
GAUSSIAN_OUTPUT
public static final MFileFormat GAUSSIAN_OUTPUT
Gaussian output format.
-
SYBYLMOL
public static final MFileFormat SYBYLMOL
Tripos SYBYL molfiles.
-
MOL2
public static final MFileFormat MOL2
Tripos Mol2 files.
-
PDB
public static final MFileFormat PDB
Protein Data Bank format.
-
GZIP
public static final MFileFormat GZIP
GZIPped file.
-
BASE64
public static final MFileFormat BASE64
BASE64 encoded file.
-
AWT_IMAGE
public static final MFileFormat AWT_IMAGE
Image object (java.awt.Image).
-
JPEG
public static final MFileFormat JPEG
JPEG format.
-
PNG
public static final MFileFormat PNG
Portable Network Graphics.
-
MSBMP
public static final MFileFormat MSBMP
Windows Bitmap format.
-
PDF
public static final MFileFormat PDF
Portable Document Format.
-
SVG
public static final MFileFormat SVG
Scalable Vector Graphics.
-
EPS
public static final MFileFormat EPS
Encapsulated PostScript vector image format.
-
TIFF
public static final MFileFormat TIFF
Tagged Image File Format.
-
EMF
public static final MFileFormat EMF
Windows Enhanced Metafiles.
-
POVRAY
public static final MFileFormat POVRAY
POVRay file.
-
OSRA
public static final MFileFormat OSRA
-
CDX
public static final MFileFormat CDX
ChemDraw CDX file.
-
CDXML
public static final MFileFormat CDXML
ChemDraw CDXML file.
-
D2S
public static final MFileFormat D2S
Any document format recognized by Document to Structure (doc, odt, ...).
-
FASTA
public static final MFileFormat FASTA
FASTA file format
-
FASTA_DNA
public static final MFileFormat FASTA_DNA
FASTA file format with DNA sequence
-
FASTA_RNA
public static final MFileFormat FASTA_RNA
FASTA file format with RNA sequence
-
FASTA_PEPTIDE
public static final MFileFormat FASTA_PEPTIDE
FASTA file format with peptide sequence
-
SKC
public static final MFileFormat SKC
SKC file format
-
ACCORD
public static final MFileFormat ACCORD
ACCORD file format
-
CSV
public static final MFileFormat CSV
-
VMN
public static final MFileFormat VMN
-
F_EXPORT
public static final long F_EXPORT
Export is possible if this flag is set.- See Also:
- Constant Field Values
-
F_IMPORT
public static final long F_IMPORT
Import is possible if this flag is set.- See Also:
- Constant Field Values
-
F_RECOGNIZER
public static final long F_RECOGNIZER
Format recognizer exists if this flag is set. Automatically set by the constructor if the recognizer argument is notnull
.- See Also:
- Constant Field Values
-
F_BINARY
public static final long F_BINARY
Import/export module handles binary (byte array) data.- See Also:
- Constant Field Values
-
F_OBJECT
public static final long F_OBJECT
Import/export module creates or reads a java object.- See Also:
- Constant Field Values
-
F_MOLECULE
public static final long F_MOLECULE
The format can store molecule(s) if this flag is set.- See Also:
- Constant Field Values
-
F_REACTION
public static final long F_REACTION
The format can store reaction(s) if this flag is set.- See Also:
- Constant Field Values
-
F_ARCHIVE
public static final long F_ARCHIVE
General archive format that stores a file in another format.- See Also:
- Constant Field Values
-
F_GRAPHICS
public static final long F_GRAPHICS
File format readable by a graphics program (image viewer, ray tracer etc.).- See Also:
- Constant Field Values
-
F_IMAGE
public static final long F_IMAGE
2D image file format, readable by image viewers.- See Also:
- Constant Field Values
-
F_COORDS
public static final long F_COORDS
The format can store atom coordinates if this flag is set.- See Also:
- Constant Field Values
-
F_MULTIPLE_RECORDS_LEGAL
public static final long F_MULTIPLE_RECORDS_LEGAL
The format is designed to store multiple records if this flag is set.- See Also:
- Constant Field Values
-
F_MULTIPLE_RECORDS_POSSIBLE
public static final long F_MULTIPLE_RECORDS_POSSIBLE
The import/export modules can handle files with multiple records if this flag is set, but according to the format definition it is not legal. Other programs may not import multiple records just the first one.- See Also:
- Constant Field Values
-
F_MIXED
public static final long F_MIXED
Storage of records in different formats is possible if this flag is set.- See Also:
- Constant Field Values
-
F_XML
public static final long F_XML
The format is XML based if this flag is set.- See Also:
- Constant Field Values
-
F_USER_DEFINED
public static final long F_USER_DEFINED
User defined format.- See Also:
- Constant Field Values
-
F_SINGLE_LINE
public static final long F_SINGLE_LINE
Format uses one line per structure.- Since:
- Marvin 5.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MFileFormat
public MFileFormat(String desc, String format, String mime, String exts, String rrname, String impname, String expname, String recogn, long f)
Creates a format descriptor. The recogn argument specifies the recognizer module name and the priority of the format, separated by a space. If the format has more than one subformats, then their priorities are specified here in the form"format1=priority1 format2=priority2 ..."
.- Parameters:
desc
- the format descriptionformat
- the formatmime
- the MIME type ornull
if unknownexts
- the file extensions separated by spacesrrname
- name of the record reader moduleimpname
- name of the import moduleexpname
- name of the export modulerecogn
- the file format recognizer module name and the priority (nonnegative integer)f
- the flags
-
-
Method Detail
-
getName
public String getName()
Gets the codename of the format.- Returns:
- the codename
-
getNames
public String[] getNames()
Gets all the codenames of the format.- Returns:
- the codenames
-
getDescription
public String getDescription()
Gets the format description.- Returns:
- the description
-
getExtensions
public String[] getExtensions()
Gets the extension list.- Returns:
- the extension list
-
getMIMEType
@Deprecated public String getMIMEType()
Deprecated.as of Marvin 2014.07.21.0 not usedGets the MIME type.- Returns:
- the MIME type or
null
if unknown
-
getFlags
public long getFlags()
Gets the format descriptor flags.- Returns:
- the flags
-
getAssociatedQueryFormat
public MFileFormat getAssociatedQueryFormat()
Gets the associated query format.- Returns:
- the associated format or
null
-
getAssociatedNonQueryFormat
public MFileFormat getAssociatedNonQueryFormat()
Gets the associated non-query format.- Returns:
- the associated format or
null
-
getPriority
@Deprecated public int getPriority(String subfmt)
Deprecated.as of Marvin 2014.07.21.0 usegetSubFormatPriority(String)
insteadGets the priority determining format recognition order.- Parameters:
subfmt
- the name of the subformat ornull
- Returns:
- zero or a positive number
- Throws:
IllegalArgumentException
- if priority for the specified subformat is not defined- Since:
- Marvin 5.1, 07/29/2008
-
getSubFormatPriority
public static int getSubFormatPriority(String subFormatName)
Gets the priority of the specified subformat name.- Parameters:
subFormatName
- the name of the subformat- Returns:
- zero or a positive number
- Throws:
IllegalArgumentException
- if priority for the specified subformat is not defined- Since:
- Marvin 5.1, 07/29/2008
-
matches
public boolean matches(String fmt, long f, long mask)
Tests whether the format matches the specified pattern.- Parameters:
fmt
- the format name ornull
if not importantf
- these flags must be setmask
- only bits specified here are taken into account- Returns:
true
if it matches,false
otherwise
-
isFlagSet
public boolean isFlagSet(long flag)
Checks whether the format has a given (set of) flag(s) set.- Parameters:
flag
- the flag (or set of flags) to be test- Returns:
- true if (all of) the given flag(s) is set, false otherwise
- Since:
- Marvin 5.1
-
createRecordReader
public MRecordReader createRecordReader(MolInputStream mis, String opts) throws MolFormatException
Creates the record reader.- Parameters:
mis
- the molecule input streamopts
- the options ornull
- Returns:
- the record reader
or
null
if there is no record reader for this format - Throws:
IllegalCharsetNameException
- if illegal encoding is usedUnsupportedCharsetException
- if unsupported encoding is usedSecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- See Also:
MFileFormatUtil.createRecordReader(InputStream, String)
-
createImportModule
public MolImportModule createImportModule() throws MolFormatException
Creates the molecule import module.- Returns:
- the molecule import module
or
null
if there is no importer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
-
createExportModule
public MolExportModule createExportModule() throws MolExportException
Creates the export module.- Returns:
- the molecul export module
or
null
if there is no exporter for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolExportException
- See Also:
MFileFormatUtil.createExportModule(String)
-
createExportModule
public MolExportModule createExportModule(String enc) throws MolExportException
Creates the export module.- Parameters:
enc
- the encoding- Returns:
- the molecul export module
or
null
if there is no exporter for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolExportException
- See Also:
MFileFormatUtil.createExportModule(String)
-
createRecognizer
public Recognizer createRecognizer() throws MolFormatException
Creates a recognizer module.- Returns:
- the recognizer module
or
null
if there is no recognizer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- if the recognizer module cannot be created
-
createRecognizer
@Deprecated public Recognizer createRecognizer(String fmt) throws MolFormatException
Deprecated.as of Marvin 2014.07.21.0 usecreateRecognizer()
insteadCreates a recognizer module.- Parameters:
fmt
- the (sub)format's codename- Returns:
- the recognizer module
or
null
if there is no recognizer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- if the recognizer module cannot be created
-
toString
public String toString()
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@
', the unsigned hexadecimal representation of the hash code of the object and the format name(s) in square brackets.
-
-