/** * * Takes an object which subclasses IChemObject, e.g. Molecule, and will * read this (from file, database, internet etc). If the specific * implementation does not support a specific IChemObject it will throw * an Exception. * * @param oObj The object that subclasses IChemObject * @return The IChemObject read * @exception CDKException * */ @Override public <T extends IChemObject> T read(T oObj) throws CDKException { if (oObj instanceof IChemFile) { return (T) readChemFile((IChemFile) oObj); } else { throw new CDKException("Only supported is reading of ChemFile objects."); } }
/** * * Takes an object which subclasses IChemObject, e.g. Molecule, and will * read this (from file, database, internet etc). If the specific * implementation does not support a specific IChemObject it will throw * an Exception. * * @param oObj The object that subclasses IChemObject * @return The IChemObject read * @exception CDKException * */ @Override public <T extends IChemObject> T read(T oObj) throws CDKException { if (oObj instanceof IChemFile) { return (T) readChemFile((IChemFile) oObj); } else { throw new CDKException("Only supported is reading of ChemFile objects."); } }