@Override
    public <T extends IChemObject> T read(T object) throws CDKException {
        if (object instanceof IAtomContainerSet) {
            IAtomContainerSet cf = (IAtomContainerSet) object;
            try {
                cf = readAtomContainerSet(cf);
            } catch (IOException e) {
                logger.error("Input/Output error while reading from input.");
            }
            return (T) cf;
        } else if (object instanceof IChemFile) {
            IChemFile chemFile = (IChemFile) object;
            IChemSequence chemSeq = object.getBuilder().newInstance(IChemSequence.class);
            IChemModel chemModel = object.getBuilder().newInstance(IChemModel.class);
            IAtomContainerSet molSet = object.getBuilder().newInstance(IAtomContainerSet.class);
            try {
                molSet = readAtomContainerSet(molSet);
            } catch (IOException e) {
                logger.error("Input/Output error while reading from input.");
            }
            chemModel.setMoleculeSet(molSet);
            chemSeq.addChemModel(chemModel);
            chemFile.addChemSequence(chemSeq);
            return (T) chemFile;
        } else {
            throw new CDKException("Only supported is reading of IAtomContainerSet.");
        }
    }
@ Override public < T extends IChemObject > T read ( T object ) throws CDKException { if ( object instanceof IAtomContainerSet ) { IAtomContainerSet cf = ( IAtomContainerSet ) object ; try { cf = readAtomContainerSet ( cf ) ; } catch ( IOException e ) { logger . error ( "Input/Output error while reading from input." ) ; } return ( T ) cf ; } else if ( object instanceof IChemFile ) { IChemFile chemFile = ( IChemFile ) object ; IChemSequence chemSeq = object . getBuilder ( ) . newInstance ( IChemSequence . class ) ; IChemModel chemModel = object . getBuilder ( ) . newInstance ( IChemModel . class ) ; IAtomContainerSet molSet = object . getBuilder ( ) . newInstance ( IAtomContainerSet . class ) ; try { molSet = readAtomContainerSet ( molSet ) ; } catch ( IOException e ) { logger . error ( "Input/Output error while reading from input." ) ; } chemModel . setMoleculeSet ( molSet ) ; chemSeq . addChemModel ( chemModel ) ; chemFile . addChemSequence ( chemSeq ) ; return ( T ) chemFile ; } else { throw new CDKException ( "Only supported is reading of IAtomContainerSet." ) ; } }
Read a {@link IAtomContainerSet} from the input source.

@param  object an {@link IAtomContainerSet} into which the data is stored.
@return        the content in a {@link IAtomContainerSet} object