Permalink
Browse files

Updated for the new generics 'T read(T)' API in ISimpleChemObjectReader.

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
egonw authored and rajarshi committed Feb 27, 2010
1 parent 9775992 commit d3f2f190df73fa07af9aa8863a9ed9d625e3aa12
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/org/openscience/cdk/io/MDLV2000Reader.java
@@ -173,13 +173,13 @@ public boolean accepts(Class<? extends IChemObject> classObject) {
*@return The IChemObject read
*@exception CDKException
*/
- public IChemObject read(IChemObject object) throws CDKException {
+ public <T extends IChemObject> T read(T object) throws CDKException {
if (object instanceof IChemFile) {
- return readChemFile((IChemFile)object);
+ return (T)readChemFile((IChemFile)object);
} else if (object instanceof IChemModel) {
- return readChemModel((IChemModel)object);
+ return (T)readChemModel((IChemModel)object);
} else if (object instanceof IMolecule) {
- return readMolecule((IMolecule)object);
+ return (T)readMolecule((IMolecule)object);
} else {
throw new CDKException("Only supported are ChemFile and Molecule.");
}

0 comments on commit d3f2f19

Please sign in to comment.