/** * {@inheritDoc} */ @Override public List<IBond> getConnectedBondsList(IAtom atom) { BaseAtomRef atomref = getAtomRef(atom); return new ArrayList<>(atomref.bonds); }
/** * {@inheritDoc} */ @Override public List<IBond> getConnectedBondsList(IAtom atom) { BaseAtomRef atomref = getAtomRef(atom); return new ArrayList<>(atomref.bonds); }
/** * {@inheritDoc} */ @Override public int getConnectedSingleElectronsCount(IAtom atom) { getAtomRef(atom); int count = 0; for (int i = 0; i < numSingleElectrons; i++) { if (electrons[i].contains(atom)) ++count; } return count; }
/** * {@inheritDoc} */ @Override public List<ILonePair> getConnectedLonePairsList(IAtom atom) { getAtomRef(atom); List<ILonePair> lps = new ArrayList<>(); for (int i = 0; i < numLonePairs; i++) { if (lonepairs[i].contains(atom)) lps.add(lonepairs[i]); } return lps; }
/** * {@inheritDoc} */ @Override public List<ISingleElectron> getConnectedSingleElectronsList(IAtom atom) { getAtomRef(atom); List<ISingleElectron> ses = new ArrayList<>(); for (int i = 0; i < numSingleElectrons; i++) { if (electrons[i].contains(atom)) ses.add(electrons[i]); } return ses; }
/** * {@inheritDoc} */ @Override public int getConnectedBondsCount(IAtom atom) { return getAtomRef(atom).getBondCount(); }
/** * {@inheritDoc} */ @Override public List<ISingleElectron> getConnectedSingleElectronsList(IAtom atom) { getAtomRef(atom); List<ISingleElectron> ses = new ArrayList<>(); for (int i = 0; i < numSingleElectrons; i++) { if (electrons[i].contains(atom)) ses.add(electrons[i]); } return ses; }
/** * {@inheritDoc} */ @Override public int getConnectedBondsCount(IAtom atom) { return getAtomRef(atom).getBondCount(); }
/** * {@inheritDoc} */ @Override public List<ILonePair> getConnectedLonePairsList(IAtom atom) { getAtomRef(atom); List<ILonePair> lps = new ArrayList<>(); for (int i = 0; i < numLonePairs; i++) { if (lonepairs[i].contains(atom)) lps.add(lonepairs[i]); } return lps; }
/** * {@inheritDoc} */ @Override public int getConnectedSingleElectronsCount(IAtom atom) { getAtomRef(atom); int count = 0; for (int i = 0; i < numSingleElectrons; i++) { if (electrons[i].contains(atom)) ++count; } return count; }
/** * {@inheritDoc} */ @Override public int getConnectedLonePairsCount(IAtom atom) { // check atom is present getAtomRef(atom); int count = 0; for (int i = 0; i < numLonePairs; i++) { if (lonepairs[i].contains(atom)) ++count; } return count; }
/** * {@inheritDoc} */ @Override public int getConnectedLonePairsCount(IAtom atom) { // check atom is present getAtomRef(atom); int count = 0; for (int i = 0; i < numLonePairs; i++) { if (lonepairs[i].contains(atom)) ++count; } return count; }
private void addToEndpoints(BaseBondRef bondref) { if (bondref.getAtomCount() == 2) { BaseAtomRef beg = getAtomRef(bondref.getBegin()); BaseAtomRef end = getAtomRef(bondref.getEnd()); beg.bonds.add(bondref); end.bonds.add(bondref); } else { for (int i = 0; i < bondref.getAtomCount(); i++) { getAtomRef(bondref.getAtom(i)).bonds.add(bondref); } } }
private void addToEndpoints(BaseBondRef bondref) { if (bondref.getAtomCount() == 2) { BaseAtomRef beg = getAtomRef(bondref.getBegin()); BaseAtomRef end = getAtomRef(bondref.getEnd()); beg.bonds.add(bondref); end.bonds.add(bondref); } else { for (int i = 0; i < bondref.getAtomCount(); i++) { getAtomRef(bondref.getAtom(i)).bonds.add(bondref); } } }
/** * {@inheritDoc} */ @Override public List<IAtom> getConnectedAtomsList(IAtom atom) { AtomRef aref = getAtomRef(atom); List<IAtom> nbrs = new ArrayList<>(aref.getBondCount()); for (IBond bond : aref.bonds()) { nbrs.add(bond.getOther(atom)); } return nbrs; }
/** * {@inheritDoc} */ @Override public List<IAtom> getConnectedAtomsList(IAtom atom) { AtomRef aref = getAtomRef(atom); List<IAtom> nbrs = new ArrayList<>(aref.getBondCount()); for (IBond bond : aref.bonds()) { nbrs.add(bond.getOther(atom)); } return nbrs; }
/** * {@inheritDoc} */ @Override public double getBondOrderSum(IAtom atom) { double count = 0; for (IBond bond : getAtomRef(atom).bonds()) { Order order = bond.getOrder(); if (order != null) { count += order.numeric(); } } return count; }
private BaseBondRef newBondRef(IBond bond) { BaseAtomRef beg = bond.getBegin() == null ? null : getAtomRef(bond.getBegin()); BaseAtomRef end = bond.getEnd() == null ? null : getAtomRef(bond.getEnd()); if (bond.getClass() == Bond.class) return new BaseBondRef(this, bond, beg, end); bond = unbox(bond); if (bond instanceof IQueryBond) return new QueryBondRef(this, (IQueryBond) bond, beg, end); return new BaseBondRef(this, bond, beg, end); }
/** * {@inheritDoc} */ @Override public double getBondOrderSum(IAtom atom) { double count = 0; for (IBond bond : getAtomRef(atom).bonds()) { Order order = bond.getOrder(); if (order != null) { count += order.numeric(); } } return count; }
private BaseBondRef newBondRef(IBond bond) { BaseAtomRef beg = bond.getBegin() == null ? null : getAtomRef(bond.getBegin()); BaseAtomRef end = bond.getEnd() == null ? null : getAtomRef(bond.getEnd()); if (bond.getClass() == Bond.class) return new BaseBondRef(this, bond, beg, end); bond = unbox(bond); if (bond instanceof IQueryBond) return new QueryBondRef(this, (IQueryBond) bond, beg, end); return new BaseBondRef(this, bond, beg, end); }