Permalink
Browse files

Removed the last traces of the IMoleculeSet interface

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
1 parent 50aa11f commit a8c03affd4321ab823e5d67fc9a38c8180887d86 @egonw egonw committed with rajarshi Dec 10, 2011
Showing with 149 additions and 1,004 deletions.
  1. +1 −1 src/main/org/openscience/cdk/ChemModel.java
  2. +1 −4 src/main/org/openscience/cdk/DefaultChemObjectBuilder.java
  3. +0 −187 src/main/org/openscience/cdk/MoleculeSet.java
  4. +0 −85 src/main/org/openscience/cdk/interfaces/IMoleculeSet.java
  5. +8 −8 src/main/org/openscience/cdk/io/CTXReader.java
  6. +8 −9 src/main/org/openscience/cdk/io/MoSSOutputReader.java
  7. +2 −2 src/main/org/openscience/cdk/io/PCCompoundASNReader.java
  8. +0 −1 src/main/org/openscience/cdk/io/SDFWriter.java
  9. +1 −1 src/main/org/openscience/cdk/io/ZMatrixReader.java
  10. +5 −9 src/main/org/openscience/cdk/io/inchi/INChIHandler.java
  11. +2 −1 src/main/org/openscience/cdk/io/rdf/CDKOWLReader.java
  12. +13 −28 src/main/org/openscience/cdk/libio/cml/Convertor.java
  13. +5 −6 src/main/org/openscience/cdk/libio/jena/Convertor.java
  14. +2 −2 src/main/org/openscience/cdk/libio/md/MDMolecule.java
  15. +1 −2 src/main/org/openscience/cdk/smsd/filters/ChemicalFilters.java
  16. +2 −2 src/main/org/openscience/cdk/tools/IonizationPotentialTool.java
  17. +3 −4 src/main/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java
  18. +2 −9 src/test/org/openscience/cdk/ChangeEventPropagationTest.java
  19. +0 −45 src/test/org/openscience/cdk/MoleculeSetTest.java
  20. +5 −5 src/test/org/openscience/cdk/interfaces/AbstractChemModelTest.java
  21. +0 −502 src/test/org/openscience/cdk/interfaces/AbstractMoleculeSetTest.java
  22. +2 −2 src/test/org/openscience/cdk/io/MDLRXNReaderTest.java
  23. +2 −4 src/test/org/openscience/cdk/io/MDLV2000WriterTest.java
  24. +8 −7 src/test/org/openscience/cdk/io/MoSSOutputReaderTest.java
  25. +5 −8 src/test/org/openscience/cdk/io/SDFWriterTest.java
  26. +10 −10 src/test/org/openscience/cdk/io/SMILESReaderTest.java
  27. +2 −2 src/test/org/openscience/cdk/io/SMILESWriterTest.java
  28. +9 −8 src/test/org/openscience/cdk/io/cml/CMLRoundTripTest.java
  29. +1 −1 src/test/org/openscience/cdk/io/cml/CMLRoundTripTool.java
  30. +13 −13 src/test/org/openscience/cdk/libio/jena/ConvertorTest.java
  31. +2 −2 src/test/org/openscience/cdk/libio/md/MDMoleculeTest.java
  32. +0 −2 src/test/org/openscience/cdk/modulesuites/MdataTests.java
  33. +3 −3 src/test/org/openscience/cdk/silent/ChemModelTest.java
  34. +3 −2 src/test/org/openscience/cdk/structgen/stochastic/operator/CrossoverMachineTest.java
  35. +6 −7 src/test/org/openscience/cdk/tools/IDCreatorTest.java
  36. +8 −8 src/test/org/openscience/cdk/tools/manipulator/ChemFileManipulatorTest.java
  37. +12 −9 src/test/org/openscience/cdk/tools/manipulator/MoleculeSetManipulatorTest.java
  38. +2 −3 src/test/org/openscience/cdk/tools/manipulator/ReactionSchemeManipulatorTest.java
@@ -230,7 +230,7 @@ public Object clone() throws CloneNotSupportedException {
ChemModel clone = (ChemModel)super.clone();
// clone the content
if (setOfMolecules != null) {
- clone.setOfMolecules = (MoleculeSet)((MoleculeSet)setOfMolecules).clone();
+ clone.setOfMolecules = (IAtomContainerSet)setOfMolecules.clone();
} else {
clone.setOfMolecules = null;
}
@@ -40,6 +40,7 @@
import org.openscience.cdk.interfaces.IChemFile;
import org.openscience.cdk.interfaces.IChemModel;
import org.openscience.cdk.interfaces.IChemObject;
+import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IChemSequence;
import org.openscience.cdk.interfaces.ICrystal;
import org.openscience.cdk.interfaces.IElectronContainer;
@@ -51,9 +52,7 @@
import org.openscience.cdk.interfaces.IMolecularFormula;
import org.openscience.cdk.interfaces.IMolecularFormulaSet;
import org.openscience.cdk.interfaces.IMolecule;
-import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IMonomer;
-import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IPDBAtom;
import org.openscience.cdk.interfaces.IPDBMonomer;
import org.openscience.cdk.interfaces.IPDBPolymer;
@@ -132,8 +131,6 @@ public static IChemObjectBuilder getInstance() {
if (params.length == 0) return (T)new Polymer();
} else if (IRingSet.class.isAssignableFrom(clazz)) {
if (params.length == 0) return (T)new RingSet();
- } else if (IMoleculeSet.class.isAssignableFrom(clazz)) {
- if (params.length == 0) return (T)new MoleculeSet();
} else if (IAtomContainerSet.class.isAssignableFrom(clazz)) {
if (params.length == 0) return (T)new AtomContainerSet();
} else if (IAtomContainer.class.isAssignableFrom(clazz)) {
@@ -1,187 +0,0 @@
-/* $RCSfile$
- * $Author$
- * $Date$
- * $Revision$
- *
- * Copyright (C) 1997-2007 Christoph Steinbeck <steinbeck@users.sf.net>
- *
- * Contact: cdk-devel@lists.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-package org.openscience.cdk;
-
-import org.openscience.cdk.interfaces.IAtomContainer;
-import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
-import org.openscience.cdk.interfaces.IMolecule;
-import org.openscience.cdk.interfaces.IMoleculeSet;
-
-/**
- * A set of molecules, for example those taking part in a reaction.
- *
- * To retrieve the molecules from the set, there are two options:
- *
- * <pre>
- * Molecule[] mols = setOfMolecules.getMolecules();
- * for (int i=0; i < mols.length; i++) {
- * Molecule mol = mols[i];
- * }
- * </pre>
- *
- * and
- *
- * <pre>
- * for (int i=0; i < setOfMolecules.getAtomContainerCount(); i++) {
- * Molecule mol = setOfMolecules.getMolecule(i);
- * }
- * </pre>
- *
- * @cdk.module data
- * @cdk.githash
- *
- * @cdk.keyword reaction
- * @cdk.keyword molecule
- */
-public class MoleculeSet extends AtomContainerSet implements IMoleculeSet, Cloneable {
-
- /**
- * Determines if a de-serialized object is compatible with this class.
- *
- * This value must only be changed if and only if the new version
- * of this class is incompatible with the old version. See Sun docs
- * for <a href=http://java.sun.com/products/jdk/1.1/docs/guide
- * /serialization/spec/version.doc.html>details</a>.
- *
- */
- private static final long serialVersionUID = -861287315770869699L;
-
- public MoleculeSet() {}
-
- /**
- * Adds an atomContainer to this container.
- *
- * @param atomContainer The IMolecule to be added to this container
- * @throws IllegalArgumentException when the passed IAtomContainer is not
- * an IMolecule.
- */
- public void addAtomContainer(IAtomContainer atomContainer) {
- super.addAtomContainer(atomContainer);
- }
-
- /**
- * Adds an atomContainer to this container with the given
- * multiplier.
- *
- * @param atomContainer The atomContainer to be added to this container
- * @param multiplier The multiplier of this atomContainer
- * @throws IllegalArgumentException when the passed IAtomContainer is not
- * an IMolecule.
- */
- public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
- super.addAtomContainer(atomContainer, multiplier);
- }
-
- /**
- * Adds an molecule to this container.
- *
- * @param molecule The molecule to be added to this container
- */
- public void addMolecule(IMolecule molecule) {
- super.addAtomContainer(molecule);
- /* notifyChanged() called in super.addAtomContainer() */
- }
-
- /**
- * Adds all molecules in the MoleculeSet to this container.
- *
- * @param moleculeSet The MoleculeSet
- */
- public void add(IMoleculeSet moleculeSet) {
- for (IAtomContainer mol : moleculeSet.molecules()) {
- addAtomContainer(mol);
- }
- }
-
- public void setMolecules(IMolecule[] molecules)
- {
- if (atomContainerCount > 0) removeAllAtomContainers();
- for (IMolecule molecule : molecules) {
- addMolecule(molecule);
- }
- }
-
- /**
- * Returns the array of Molecules of this container.
- *
- * @return The array of Molecules of this container
- * @see #setMolecules
- */
- public Iterable<IAtomContainer> molecules() {
- return super.atomContainers();
- }
-
-
- /**
- *
- * Returns the Molecule at position <code>number</code> in the
- * container.
- *
- * @param number The position of the Molecule to be returned.
- * @return The Molecule at position <code>number</code> .
- */
- public IMolecule getMolecule(int number) {
- IAtomContainer container = super.getAtomContainer(number);
- if (container instanceof IMolecule) return (IMolecule)container;
- return getBuilder().newInstance(IMolecule.class, container);
- }
-
- /**
- * Returns the number of Molecules in this Container.
- *
- * @return The number of Molecules in this Container
- */
- public int getMoleculeCount() {
- return super.getAtomContainerCount();
- }
-
-
- /**
- * Clones this MoleculeSet and its content.
- *
- *@return the cloned object
- */
- public Object clone() throws CloneNotSupportedException {
- return (MoleculeSet)super.clone();
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("MoleculeSet(");
- buffer.append(super.toString());
- buffer.append(')');
- return buffer.toString();
- }
-
- /**
- * Called by objects to which this object has
- * registered as a listener.
- *
- *@param event A change event pointing to the source of the change
- */
- public void stateChanged(IChemObjectChangeEvent event)
- {
- notifyChanged(event);
- }
-}
@@ -1,85 +0,0 @@
-/* $RCSfile$
- * $Author$
- * $Date$
- * $Revision$
- *
- * Copyright (C) 2006-2007 Egon Willighagen <egonw@users.sf.net>
- *
- * Contact: cdk-devel@lists.sourceforge.net
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-package org.openscience.cdk.interfaces;
-
-/**
- * Represents a set of Molecules.
- *
- * @cdk.module interfaces
- * @cdk.githash
- * @author egonw
- * @cdk.created 2005-08-25
- */
-public interface IMoleculeSet extends IAtomContainerSet {
-
- /**
- * Adds an IMolecule to this container.
- *
- * @param molecule The molecule to be added to this container
- */
- public void addMolecule(IMolecule molecule);
-
- /**
- * Adds all molecules in the MoleculeSet to this container.
- *
- * @param moleculeSet The MoleculeSet to add
- */
- public void add(IMoleculeSet moleculeSet);
-
- /**
- * Sets the molecules in the IMoleculeSet, removing previously added
- * IMolecule's.
- *
- * @param molecules New set of molecules
- * @see #molecules()
- */
- public void setMolecules(IMolecule[] molecules);
-
- /**
- * Returns the array of Molecules of this container.
- *
- * @return The array of Molecules of this container
- * @see #setMolecules(IMolecule[])
- */
- public Iterable<IAtomContainer> molecules();
-
- /**
- * Returns the Molecule at position <code>number</code> in the
- * container.
- *
- * @param number The position of the Molecule to be returned.
- * @return The Molecule at position <code>number</code> .
- */
- public IMolecule getMolecule(int number);
-
-
- /**
- * Returns the number of Molecules in this Container.
- *
- * @return The number of Molecules in this Container
- */
- public int getMoleculeCount();
-
-}
-
@@ -23,32 +23,32 @@
*/
package org.openscience.cdk.io;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
+import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemFile;
import org.openscience.cdk.interfaces.IChemModel;
import org.openscience.cdk.interfaces.IChemObject;
import org.openscience.cdk.interfaces.IChemSequence;
import org.openscience.cdk.interfaces.IMolecule;
-import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.io.formats.CTXFormat;
import org.openscience.cdk.io.formats.IResourceFormat;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;
import org.openscience.cdk.tools.manipulator.BondManipulator;
import org.openscience.cdk.tools.periodictable.PeriodicTable;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
/**
* Reader that extracts information from the IDENT, NAME, ATOMS and BONDS
* blocks in CTX files.
@@ -124,7 +124,7 @@ public boolean accepts(Class classObject) {
private IChemFile readChemFile() throws CDKException {
IChemSequence seq = file.getBuilder().newInstance(IChemSequence.class);
IChemModel model = file.getBuilder().newInstance(IChemModel.class);
- IMoleculeSet containerSet = file.getBuilder().newInstance(IMoleculeSet.class);
+ IAtomContainerSet containerSet = file.getBuilder().newInstance(IAtomContainerSet.class);
IMolecule container = file.getBuilder().newInstance(IMolecule.class);
int lineNumber = 0;
Oops, something went wrong.

0 comments on commit a8c03af

Please sign in to comment.