Permalink
Browse files

license and class refactoring

  • Loading branch information...
1 parent 12c6f32 commit 44463f285e1b96d747f12499d89a0f42ac7cf9e4 @asad committed Nov 10, 2011
View
27 src/cdkhashedfingerprint/Base.java
@@ -1,6 +1,27 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 cdkhashedfingerprint;
View
27 src/cdkhashedfingerprint/BenchmarkHashedFingerprint.java
@@ -1,6 +1,27 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 cdkhashedfingerprint;
View
7 src/fingerprints/Fingerprinter.java
@@ -26,7 +26,6 @@
*/
package fingerprints;
-import helper.RandomNumber;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
@@ -98,7 +97,7 @@
* @cdk.githash
*/
@TestClass("org.openscience.cdk.fingerprint.FingerprinterTest")
-public class Fingerprinter implements IFingerprinter {
+public class Fingerprinter extends RandomNumber implements IFingerprinter {
private int size;
private boolean respectRingMatches;
@@ -173,7 +172,7 @@ public BitSet getFingerprint(IAtomContainer container,
hashes = findPaths(container, searchDepth);
for (int hash : hashes) {
- position = (int) RandomNumber.generateMersenneTwisterRandomNumber(size, hash);
+ position = (int) generateMersenneTwisterRandomNumber(size, hash);
bitSet.set(position);
}
@@ -203,7 +202,7 @@ public BitSet getFingerprint(IAtomContainer container)
public Map<String, Integer> getRawFingerprint(IAtomContainer atomContainer) throws CDKException {
Map<String, Integer> uniquePaths = new TreeMap<String, Integer>();
for (int hash : hashes) {
- int position = (int) RandomNumber.generateMersenneTwisterRandomNumber(size, hash);
+ int position = (int) generateMersenneTwisterRandomNumber(size, hash);
uniquePaths.put(new Integer(position).toString(), hash);
}
return uniquePaths;
View
35 src/fingerprints/IFingerprinter.java
@@ -1,6 +1,27 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 fingerprints;
@@ -11,9 +32,13 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.ringsearch.AllRingsFinder;
+
/**
- *
- * @author Asad
+ * @author Syed Asad Rahman (2011)
+ * @cdk.created 07-11-2011
+ * @cdk.keyword fingerprint
+ * @cdk.keyword similarity
+ * @cdk.module standard
*/
public interface IFingerprinter extends org.openscience.cdk.fingerprint.IFingerprinter {
View
62 src/fingerprints/RandomNumber.java
@@ -0,0 +1,62 @@
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 fingerprints;
+
+import org.apache.commons.math.random.MersenneTwister;
+import org.apache.commons.math.random.RandomAdaptor;
+import org.apache.commons.math.random.RandomGenerator;
+
+/**
+ * @author Syed Asad Rahman (2011)
+ * @cdk.created 07-11-2011
+ * @cdk.keyword fingerprint
+ * @cdk.keyword similarity
+ * @cdk.module standard
+ */
+public class RandomNumber {
+
+ /**
+ * Mersenne Twister Random Number
+ * for a hashcode within a range between 0 to maximum
+ * @param maximum
+ * @param hashCode
+ * @return
+ */
+ public static long generateMersenneTwisterRandomNumber(int maximum, long hashCode) {
+ RandomGenerator rg = new RandomAdaptor(new MersenneTwister(hashCode));
+ return rg.nextInt(maximum);
+ }
+
+ /**
+ * Mersenne Twister Random Number
+ * @param maximum
+ * @return
+ */
+ public static long generateMersenneTwisterRandomNumber(int maximum) {
+ RandomGenerator rg = new RandomAdaptor(new MersenneTwister());
+ return rg.nextInt(maximum);
+ }
+}
View
27 src/helper/Data.java
@@ -1,6 +1,27 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 helper;
View
25 src/helper/Fragmenter2.java
@@ -1,3 +1,28 @@
+/* $Revision$ $Author$ $Date$
+ *
+ * Copyright (C) 2011 Syed Asad Rahman <asad@ebi.ac.uk>
+ *
+ *
+ * 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.
+ * All we ask is that proper credit is given for our work, which includes
+ * - but is not limited to - adding the above copyright notice to the beginning
+ * of your source code files, and to any copyright notice that you may distribute
+ * with programs based on this work.
+ *
+ * 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 helper;
import java.util.ArrayList;
View
37 src/helper/RandomNumber.java
@@ -1,37 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package helper;
-
-import org.apache.commons.math.random.MersenneTwister;
-import org.apache.commons.math.random.RandomAdaptor;
-import org.apache.commons.math.random.RandomGenerator;
-
-/**
- *
- * @author Syed Asad Rahman <asad@ebi.ac.uk>
- */
-public class RandomNumber {
-
- /**
- * Mersenne Twister Random Number
- * @param maximum
- * @param hashCode
- * @return
- */
- public static long generateMersenneTwisterRandomNumber(int maximum, long hashCode) {
- RandomGenerator rg = new RandomAdaptor(new MersenneTwister(hashCode));
- return rg.nextInt(maximum);
- }
-
- /**
- * Mersenne Twister Random Number
- * @param maximum
- * @return
- */
- public static long generateMersenneTwisterRandomNumber(int maximum) {
- RandomGenerator rg = new RandomAdaptor(new MersenneTwister());
- return rg.nextInt(maximum);
- }
-}

0 comments on commit 44463f2

Please sign in to comment.