Skip to content

Commit

Permalink
Got rid of MoleculeSet from the silent module
Browse files Browse the repository at this point in the history
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
rajarshi authored and egonw committed Dec 10, 2011
1 parent 5b7ad0f commit 2250763
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 295 deletions.
12 changes: 6 additions & 6 deletions src/main/org/openscience/cdk/silent/ChemModel.java
Expand Up @@ -19,8 +19,6 @@

package org.openscience.cdk.silent;

import java.io.Serializable;

import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IChemModel;
import org.openscience.cdk.interfaces.IChemObjectChangeEvent;
Expand All @@ -29,6 +27,8 @@
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.interfaces.IRingSet;

import java.io.Serializable;

/**
* An object containing multiple MoleculeSet and
* the other lower level concepts like rings, sequences,
Expand Down Expand Up @@ -205,22 +205,22 @@ public Object clone() throws CloneNotSupportedException {
ChemModel clone = (ChemModel)super.clone();
// clone the content
if (setOfMolecules != null) {
clone.setOfMolecules = (MoleculeSet)((MoleculeSet)setOfMolecules).clone();
clone.setOfMolecules = (AtomContainerSet) setOfMolecules.clone();
} else {
clone.setOfMolecules = null;
}
if (setOfReactions != null) {
clone.setOfReactions = (IReactionSet)((ReactionSet)setOfReactions).clone();
clone.setOfReactions = (IReactionSet) setOfReactions.clone();
} else {
clone.setOfReactions = null;
}
if (crystal != null) {
clone.crystal = (Crystal)((Crystal)crystal).clone();
clone.crystal = (Crystal) crystal.clone();
} else {
clone.crystal = null;
}
if (ringSet != null) {
clone.ringSet = (RingSet)((RingSet)ringSet).clone();
clone.ringSet = (RingSet) ringSet.clone();
} else {
clone.ringSet = null;
}
Expand Down
179 changes: 0 additions & 179 deletions src/main/org/openscience/cdk/silent/MoleculeSet.java

This file was deleted.

14 changes: 5 additions & 9 deletions src/main/org/openscience/cdk/silent/SilentChemObjectBuilder.java
Expand Up @@ -18,12 +18,6 @@
*/
package org.openscience.cdk.silent;

import java.util.ArrayList;
import java.util.List;

import javax.vecmath.Point2d;
import javax.vecmath.Point3d;

import org.openscience.cdk.interfaces.IAdductFormula;
import org.openscience.cdk.interfaces.IAminoAcid;
import org.openscience.cdk.interfaces.IAtom;
Expand All @@ -49,7 +43,6 @@
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.IPDBAtom;
import org.openscience.cdk.interfaces.IPDBMonomer;
Expand All @@ -68,6 +61,11 @@
import org.openscience.cdk.interfaces.ITetrahedralChirality.Stereo;
import org.openscience.cdk.stereo.TetrahedralChirality;

import javax.vecmath.Point2d;
import javax.vecmath.Point3d;
import java.util.ArrayList;
import java.util.List;

/**
* A helper class to instantiate a {@link ICDKObject} for the original CDK
* implementation.
Expand Down Expand Up @@ -125,8 +123,6 @@ public <T extends ICDKObject>T newInstance(
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)) {
Expand Down
8 changes: 3 additions & 5 deletions src/test/org/openscience/cdk/io/ChemObjectWriterTest.java
Expand Up @@ -21,8 +21,6 @@
*/
package org.openscience.cdk.io;

import java.io.StringWriter;

import org.junit.Assert;
import org.junit.Test;
import org.openscience.cdk.exception.CDKException;
Expand All @@ -32,9 +30,10 @@
import org.openscience.cdk.silent.ChemFile;
import org.openscience.cdk.silent.ChemModel;
import org.openscience.cdk.silent.Molecule;
import org.openscience.cdk.silent.MoleculeSet;
import org.openscience.cdk.silent.Reaction;

import java.io.StringWriter;

/**
* TestCase for {@link IChemObjectWriter} implementations.
*
Expand All @@ -51,8 +50,7 @@ public static void setChemObjectWriter(IChemObjectWriter aChemObjectWriter){

private static IChemObject[] allChemObjectsTypes = {
new ChemFile(), new ChemModel(), new Molecule(),
new Reaction(), new AtomContainerSet(), new AtomContainer(),
new MoleculeSet()
new Reaction(), new AtomContainerSet(), new AtomContainer()
};

/**
Expand Down
4 changes: 1 addition & 3 deletions src/test/org/openscience/cdk/modulesuites/MsilentTests.java
Expand Up @@ -47,7 +47,6 @@
import org.openscience.cdk.silent.LonePairTest;
import org.openscience.cdk.silent.MolecularFormulaSetTest;
import org.openscience.cdk.silent.MolecularFormulaTest;
import org.openscience.cdk.silent.MoleculeSetTest;
import org.openscience.cdk.silent.MoleculeTest;
import org.openscience.cdk.silent.MonomerTest;
import org.openscience.cdk.silent.PDBAtomTest;
Expand All @@ -61,9 +60,9 @@
import org.openscience.cdk.silent.ReactionTest;
import org.openscience.cdk.silent.RingSetTest;
import org.openscience.cdk.silent.RingTest;
import org.openscience.cdk.silent.SilentChemObjectBuilderTest;
import org.openscience.cdk.silent.SingleElectronTest;
import org.openscience.cdk.silent.StrandTest;
import org.openscience.cdk.silent.SilentChemObjectBuilderTest;

/**
* TestSuite that runs the tests from the silent module.
Expand Down Expand Up @@ -101,7 +100,6 @@
RingTest.class,
RingSetTest.class,
AtomContainerSetTest.class,
MoleculeSetTest.class,
ReactionSetTest.class,
ReactionSchemeTest.class,
SingleElectronTest.class,
Expand Down

0 comments on commit 2250763

Please sign in to comment.