@Override public Object clone() throws CloneNotSupportedException { ChemSequence clone = (ChemSequence) super.clone(); // clone the chemModels clone.chemModelCount = getChemModelCount(); clone.chemModels = new ChemModel[clone.chemModelCount]; for (int f = 0; f < clone.chemModelCount; f++) { clone.chemModels[f] = (ChemModel) ((ChemModel) chemModels[f]).clone(); } return clone; }
@Override public void startDocument() { chemFile = new ChemFile(); chemSequence = new ChemSequence(); chemModel = new ChemModel(); setOfMolecules = new AtomContainerSet(); }
/** * Access a set of candidates for a given key. Candidates match the * interface an number of parameters for the constructors. A key may * match when it's parameters are subclasses. * * @param key the key to find possible candidates for * @return set of constructors which 'could' match the given key */ public Set<ConstructorKey> getCandidates(ConstructorKey key) { return getCandidates(key.intf(), key.n()); }
/** * {@inheritDoc} */ @Override public IAtomContainer newAtomContainer() { if (CDK_LEGACY_AC) return new AtomContainer(); else return new AtomContainer2(); } }
/** * {@inheritDoc} */ @Override public int indexOf(IAtom atom) { final AtomRef aref = getAtomRefUnsafe(atom); return aref == null ? -1 : aref.getIndex(); }
/** * {@inheritDoc} */ @Override public IBond getBond(IAtom beg, IAtom end) { final AtomRef begref = getAtomRefUnsafe(beg); return begref != null ? begref.getBond(end) : null; }
/** * {@inheritDoc} */ @Override public int indexOf(IBond bond) { final BondRef bref = getBondRefUnsafe(bond); return bref == null ? -1 : bref.getIndex(); }
/** * Add an Atom and makes it the C-terminus atom. * * @param atom The Atom that is the C-terminus * * @see #getCTerminus */ @Override public void addCTerminus(IAtom atom) { super.addAtom(atom); setCTerminus(atom); }
/** * {@inheritDoc} */ @Override public int getConnectedBondsCount(IAtom atom) { return getAtomRef(atom).getBondCount(); }
/** * Creates a constructor key for use in accessing constructors. The key * combines the interface and types in a single instance which we can then * use in a map. * * @param intf the interface to build the key for * @param types the classes that the the constructor requires * @return a constructor key which can be used to lookup a constructor */ public static ConstructorKey key(Class<?> intf, Class<?>... types) { return new ClassBasedKey(intf, convert(types)); }
/** * {@inheritDoc} */ @Override public IAtomContainer newAtomContainer() { if (CDK_LEGACY_AC) return new AtomContainer(); else return new AtomContainer2(); } }
@Override public Object clone() throws CloneNotSupportedException { ChemSequence clone = (ChemSequence) super.clone(); // clone the chemModels clone.chemModelCount = getChemModelCount(); clone.chemModels = new ChemModel[clone.chemModelCount]; for (int f = 0; f < clone.chemModelCount; f++) { clone.chemModels[f] = (ChemModel) ((ChemModel) chemModels[f]).clone(); } return clone; }
/** * {@inheritDoc} */ @Override public int indexOf(IAtom atom) { final AtomRef aref = getAtomRefUnsafe(atom); return aref == null ? -1 : aref.getIndex(); }
/** * {@inheritDoc} */ @Override public IBond getBond(IAtom beg, IAtom end) { final AtomRef begref = getAtomRefUnsafe(beg); return begref != null ? begref.getBond(end) : null; }
/** * {@inheritDoc} */ @Override public int getConnectedBondsCount(IAtom atom) { return getAtomRef(atom).getBondCount(); }