Permalink
Browse files

Removed hardcoded String use of InvPair constants in favor of their a…

…ctual constants
  • Loading branch information...
egonw committed Aug 28, 2011
1 parent 409733e commit 4777958f499ed76a8b9ebb8674f5f8ff130b0109
@@ -386,7 +386,7 @@ public synchronized String createSMILESWithoutCheckForMultipleMolecules(IAtomCon
}
//logger.debug("Setting all VISITED flags to false");
atom.setFlag(CDKConstants.VISITED, false);
- if ((Long) atom.getProperty("CanonicalLable") == 1)
+ if ((Long) atom.getProperty(InvPair.CANONICAL_LABEL) == 1)
{
start = atom;
}
@@ -455,8 +455,8 @@ public synchronized String createSMILESWithoutCheckForMultipleMolecules(IAtomCon
// remove all CanonicalLable/InvariancePair props
for (int k = 0; k < molecule.getAtomCount(); k++) {
- molecule.getAtom(k).removeProperty("CanonicalLable");
- molecule.getAtom(k).removeProperty("InvariancePair");
+ molecule.getAtom(k).removeProperty(InvPair.CANONICAL_LABEL);
+ molecule.getAtom(k).removeProperty(InvPair.INVARIANCE_PAIR);
}
return l.toString();
@@ -655,7 +655,10 @@ private List getCanNeigh(final IAtom a, final IAtomContainer container)
{
public int compare(Object o1, Object o2)
{
- return (int) ((Long) ((IAtom) o1).getProperty("CanonicalLable") - (Long) ((IAtom) o2).getProperty("CanonicalLable"));
+ return (int) (
+ (Long) ((IAtom) o1).getProperty(InvPair.CANONICAL_LABEL) -
+ (Long) ((IAtom) o2).getProperty(InvPair.CANONICAL_LABEL)
+ );
}
});
}
@@ -47,6 +47,7 @@
import org.openscience.cdk.interfaces.IRing;
import org.openscience.cdk.interfaces.IRingSet;
import org.openscience.cdk.ringsearch.SSSRFinder;
+import org.openscience.cdk.smiles.InvPair;
/**
* Generates HOSE codes {@cdk.cite BRE78}.
@@ -740,8 +741,8 @@ private void fillUpSphereDelimiters()
public int compare(TreeNode obj1, TreeNode obj2) {
if(obj1==null || obj2==null || ((TreeNode) obj1).getAtom()==null || ((TreeNode) obj2).getAtom()==null)
return 0;
- Long label1 = (Long)((TreeNode) obj1).getAtom().getProperty("CanonicalLable");
- Long label2 = (Long)((TreeNode) obj2).getAtom().getProperty("CanonicalLable");
+ Long label1 = (Long)((TreeNode) obj1).getAtom().getProperty(InvPair.CANONICAL_LABEL);
+ Long label2 = (Long)((TreeNode) obj2).getAtom().getProperty(InvPair.CANONICAL_LABEL);
if(label1==null || label2==null)
return 0;
if (label1.intValue() < label2.intValue()) {

0 comments on commit 4777958

Please sign in to comment.