Permalink
Browse files

Removed the dependency on the nonotify module

  • Loading branch information...
egonw committed May 14, 2010
1 parent a9a4aa8 commit 93e0a22f2a244a5fde5f861095f879ff19ee9222
@@ -27,7 +27,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
-import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder;
import signature.AbstractGraphBuilder;
@@ -51,13 +50,6 @@
*/
private IAtomContainer container;
- /**
- * This default constructor uses a {@link NoNotificationChemObjectBuilder}
- */
- public MoleculeFromSignatureBuilder() {
- this.builder = NoNotificationChemObjectBuilder.getInstance();
- }
-
/**
* Uses the chem object builder for making molecules.
*
@@ -27,6 +27,7 @@
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.interfaces.IAtomContainer;
+import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IMolecule;
import signature.AbstractGraphSignature;
@@ -121,12 +122,14 @@ public AbstractVertexSignature signatureForVertex(int vertexIndex) {
* strings.
*
* @param signatureString the signature string to use
+ * @param coBuilder {@link IChemObjectBuilder} to build the returned atom container from
* @return an atom container
*/
- public static IAtomContainer fromSignatureString(String signatureString) {
+ public static IAtomContainer fromSignatureString(String signatureString,
+ IChemObjectBuilder coBuilder) {
ColoredTree tree = AtomSignature.parse(signatureString);
MoleculeFromSignatureBuilder builder =
- new MoleculeFromSignatureBuilder();
+ new MoleculeFromSignatureBuilder(coBuilder);
builder.makeFromColoredTree(tree);
return builder.getAtomContainer();
}
@@ -28,6 +28,7 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
+import org.openscience.cdk.nonotify.NoNotificationChemObjectBuilder;
import signature.AbstractVertexSignature;
import signature.ColoredTree;
@@ -52,7 +53,7 @@ public String canonicalSignature(IAtomContainer atomContainer) {
public IAtomContainer reconstruct(String signature) {
ColoredTree tree = AbstractVertexSignature.parse(signature);
MoleculeFromSignatureBuilder builder =
- new MoleculeFromSignatureBuilder();
+ new MoleculeFromSignatureBuilder(NoNotificationChemObjectBuilder.getInstance());
builder.makeFromColoredTree(tree);
return builder.getAtomContainer();
}

0 comments on commit 93e0a22

Please sign in to comment.