/** * {@inheritDoc} */ @Override public String getID() { return chemobj.getID(); }
/** * {@inheritDoc} */ @Override public String getID() { return chemobj.getID(); }
/** * Constructs a new IChemObject by copying the flags, and the * identifier. It does not copy the listeners and properties. * * @param chemObject the object to copy */ public ChemObject(IChemObject chemObject) { // copy the flags flags = chemObject.getFlagValue().shortValue(); // copy the identifier identifier = chemObject.getID(); }
/** * Constructs a new IChemObject by copying the flags, and the * identifier. It does not copy the listeners and properties. * * @param chemObject the object to copy */ public ChemObject(IChemObject chemObject) { // copy the flags flags = chemObject.getFlagValue().shortValue(); // copy the identifier identifier = chemObject.getID(); }
/** * Constructs a new IChemObject by copying the flags, and the * identifier. It does not copy the listeners and properties. * * @param chemObject the object to copy */ public ChemObject(IChemObject chemObject) { // copy the flags flags = chemObject.getFlagValue().shortValue(); // copy the identifier identifier = chemObject.getID(); }
/** * Constructs a new IChemObject by copying the flags, and the * identifier. It does not copy the listeners and properties. * * @param chemObject the object to copy */ public ChemObject(IChemObject chemObject) { // copy the flags flags = chemObject.getFlagValue().shortValue(); // copy the identifier identifier = chemObject.getID(); }
@Test public void testGetID() { IChemObject chemObject = newChemObject(); Assert.assertNull(chemObject.getID()); }
/** * * @param reaction * @return */ public List<DefinedMapping> createDefinedMappings(IReaction reaction) { IAtomContainerSet reactants = reaction.getReactants(); IAtomContainerSet products = reaction.getProducts(); List<DefinedMapping> definedMappings = new ArrayList<>(); int i = 0; for (IMapping mapping : reaction.mappings()) { String id = mapping.getChemObject(0).getID(); AtomContainerAtomPair reactantPair = getByID(reactants, id); AtomContainerAtomPair productPair = getByID(products, id); int rIndex = reactantPair.getIndex(); int pIndex = productPair.getIndex(); definedMappings.add( new DefinedMapping(rIndex, pIndex, i, reactantPair.atomContainer, productPair.atomContainer)); i++; } return definedMappings; }
private List<DefinedMapping> createDefinedMappings(IReaction reaction) { IAtomContainerSet reactants = reaction.getReactants(); IAtomContainerSet products = reaction.getProducts(); List<DefinedMapping> definedMappings = new ArrayList<>(); int i = 0; for (IMapping mapping : reaction.mappings()) { String id = mapping.getChemObject(0).getID(); AtomContainerAtomPair reactantPair = getByID(reactants, id); AtomContainerAtomPair productPair = getByID(products, id); if (reactantPair != null && productPair != null) { int rIndex = reactantPair.getIndex(); int pIndex = productPair.getIndex(); definedMappings.add( new DefinedMapping(rIndex, pIndex, i, reactantPair.atomContainer, productPair.atomContainer)); i++; } } return definedMappings; }
@Test public void testSetID_String() { IChemObject chemObject = newChemObject(); String id = "objectX"; chemObject.setID(id); Assert.assertEquals(id, chemObject.getID()); }
@Test public void testClone_Identifier() throws Exception { IChemObject chemObject1 = newChemObject(); chemObject1.setID("co1"); IChemObject chemObject2 = (IChemObject) chemObject1.clone(); // test cloning of identifier field chemObject2.setID("co2"); Assert.assertEquals("co1", chemObject1.getID()); }