Skip to content

Commit

Permalink
Integer invariants, and updated signatures jarfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gilleain authored and egonw committed Jun 23, 2010
1 parent 7617074 commit 5c838b6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
Binary file modified jar/signatures-1.0-SNAPSHOT.jar
Binary file not shown.
10 changes: 10 additions & 0 deletions src/main/org/openscience/cdk/signature/AtomSignature.java
Expand Up @@ -71,6 +71,16 @@ public AtomSignature(int atomIndex, int height, IAtomContainer molecule) {
this.molecule = molecule;
super.create(atomIndex, molecule.getAtomCount(), height);
}

public AtomSignature(int atomIndex, int height,
InvariantType invariantType, IAtomContainer molecule) {
super(invariantType);
}

public int getIntLabel(int vertexIndex) {
IAtom atom = molecule.getAtom(vertexIndex);
return atom.getMassNumber();
}

/* (non-Javadoc)
* @see signature.AbstractVertexSignature#getConnected(int)
Expand Down
24 changes: 24 additions & 0 deletions src/test/org/openscience/cdk/signature/AtomSignatureTest.java
Expand Up @@ -39,6 +39,30 @@
*/
public class AtomSignatureTest extends AbstractSignatureTest {

@Test
public void integerInvariantsTest() {
IMolecule isotopeChiralMol = builder.newInstance(IMolecule.class);
isotopeChiralMol.addAtom(builder.newInstance(IAtom.class, "C"));

IAtom s32 = builder.newInstance(IAtom.class, "S");
s32.setMassNumber(32);
isotopeChiralMol.addAtom(s32);

IAtom s33 = builder.newInstance(IAtom.class, "S");
s33.setMassNumber(33);
isotopeChiralMol.addAtom(s33);

IAtom s34 = builder.newInstance(IAtom.class, "S");
s34.setMassNumber(34);
isotopeChiralMol.addAtom(s34);

IAtom s36 = builder.newInstance(IAtom.class, "S");
s36.setMassNumber(36);
isotopeChiralMol.addAtom(s36);


}

@Test
public void heightTest() {
IMolecule benzene = makeBenzene();
Expand Down

0 comments on commit 5c838b6

Please sign in to comment.