@Override public IChemObject newTestObject() { return new ElectronContainer(); } });
/** * Clones this LonePair object, including a clone of the atom for which the * lone pair is defined. * * @return The cloned object */ @Override public Object clone() throws CloneNotSupportedException { LonePair clone = (LonePair) super.clone(); // clone the Atom if (atom != null) { clone.atom = (IAtom) ((IAtom) atom).clone(); } return clone; }
@Override public String toString() { StringBuffer resultString = new StringBuffer(64); resultString.append("ElectronContainer(").append(hashCode()); if (getElectronCount() > -1) { resultString.append("EC:").append(getElectronCount()); } resultString.append(')'); return resultString.toString(); }
/** * Returns a one line string representation of this Container. This method is * conform RFC #9. * * @return The string representation of this Container */ @Override public String toString() { StringBuffer resultString = new StringBuffer(32); resultString.append("Bond(").append(this.hashCode()); if (getOrder() != null) { resultString.append(", #O:").append(getOrder()); } resultString.append(", #S:").append(getStereo()); if (getAtomCount() > 0) { resultString.append(", #A:").append(getAtomCount()); for (int i = 0; i < atomCount; i++) { resultString.append(", ").append(atoms[i] == null ? "null" : atoms[i].toString()); } } resultString.append(", ").append(super.toString()); resultString.append(')'); return resultString.toString(); }
/** * Returns a one line string representation of this Container. This method is * conform RFC #9. * * @return The string representation of this Container */ @Override public String toString() { StringBuffer resultString = new StringBuffer(32); resultString.append("Bond(").append(this.hashCode()); if (getOrder() != null) { resultString.append(", #O:").append(getOrder()); } resultString.append(", #S:").append(getStereo()); if (getAtomCount() > 0) { resultString.append(", #A:").append(getAtomCount()); for (int i = 0; i < atomCount; i++) { resultString.append(", ").append(atoms[i] == null ? "null" : atoms[i].toString()); } } resultString.append(", ").append(super.toString()); resultString.append(')'); return resultString.toString(); }
/** * Clones this LonePair object, including a clone of the atom for which the * lone pair is defined. * * @return The cloned object */ @Override public Object clone() throws CloneNotSupportedException { LonePair clone = (LonePair) super.clone(); // clone the Atom if (atom != null) { clone.atom = (IAtom) ((IAtom) atom).clone(); } return clone; }
@BeforeClass public static void setUp() { setTestObjectBuilder(new ITestObjectBuilder() { @Override public IChemObject newTestObject() { return new ElectronContainer(); } }); }
@Override public String toString() { StringBuffer resultString = new StringBuffer(64); resultString.append("ElectronContainer(").append(hashCode()); if (getElectronCount() > -1) { resultString.append("EC:").append(getElectronCount()); } resultString.append(')'); return resultString.toString(); }
/** * Clones this SingleElectron object, including a clone of the atom for which the * SingleElectron is defined. * * @return The cloned object */ @Override public Object clone() throws CloneNotSupportedException { SingleElectron clone = (SingleElectron) super.clone(); // clone the Atom if (atom != null) { clone.atom = (IAtom) ((IAtom) atom).clone(); } return clone; }
@Test public void testElectronContainer() { IElectronContainer ec = new ElectronContainer(); Assert.assertNotNull(ec); Assert.assertEquals(0, ec.getElectronCount().intValue()); }
/** * Clones this SingleElectron object, including a clone of the atom for which the * SingleElectron is defined. * * @return The cloned object */ @Override public Object clone() throws CloneNotSupportedException { SingleElectron clone = (SingleElectron) super.clone(); // clone the Atom if (atom != null) { clone.atom = (IAtom) ((IAtom) atom).clone(); } return clone; }
/** * Clones this bond object, including clones of the atoms between which the * bond is defined. * * @return The cloned object */ @Override public IBond clone() throws CloneNotSupportedException { Bond clone = (Bond) super.clone(); // clone all the Atoms if (atoms != null) { clone.atoms = new IAtom[atoms.length]; for (int f = 0; f < atoms.length; f++) { if (atoms[f] != null) { clone.atoms[f] = (IAtom) ((IAtom) atoms[f]).clone(); } } } return clone; }
/** * Clones this bond object, including clones of the atoms between which the * bond is defined. * * @return The cloned object */ @Override public IBond clone() throws CloneNotSupportedException { Bond clone = (Bond) super.clone(); // clone all the Atoms if (atoms != null) { clone.atoms = new IAtom[atoms.length]; for (int f = 0; f < atoms.length; f++) { if (atoms[f] != null) { clone.atoms[f] = (IAtom) ((IAtom) atoms[f]).clone(); } } } return clone; }