Skip to content

Commit

Permalink
Updated for the new generics 'T read(T)' API in ISimpleChemObjectReader.
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Feb 27, 2010
1 parent 9775992 commit d3f2f19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/org/openscience/cdk/io/MDLV2000Reader.java
Expand Up @@ -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.");
}
Expand Down

0 comments on commit d3f2f19

Please sign in to comment.