private BaseAtomRef newAtomRef(IAtom atom) { // most common implementation we'll encounter.. if (atom.getClass() == Atom.class) return new BaseAtomRef(this, atom); atom = unbox(atom); // re-check the common case now we've un-boxed if (atom.getClass() == Atom.class) { return new BaseAtomRef(this, atom); } else if (atom instanceof IPseudoAtom) { return new PsuedoAtomRef(this, (IPseudoAtom) atom); } else if (atom instanceof IQueryAtom) { return new QueryAtomRef(this, (IQueryAtom) atom); } else if (atom instanceof IPDBAtom) { return new PdbAtomRef(this, (IPDBAtom) atom); } else { return new BaseAtomRef(this, atom); } }
atoms[i] = this.atoms[i].deref().clone();
atoms[i] = this.atoms[i].deref().clone();
/** * {@inheritDoc} */ @Override public Order getMinimumBondOrder(IAtom atom) { IBond.Order min = null; for (IBond bond : getAtomRef(atom).bonds()) { if (min == null || bond.getOrder().numeric() < min.numeric()) { min = bond.getOrder(); } } if (min == null) { if (atom.getImplicitHydrogenCount() != null && atom.getImplicitHydrogenCount() > 0) min = Order.SINGLE; else min = Order.UNSET; } return min; }
/** * {@inheritDoc} */ @Override public Order getMaximumBondOrder(IAtom atom) { IBond.Order max = null; for (IBond bond : getAtomRef(atom).bonds()) { if (max == null || bond.getOrder().numeric() > max.numeric()) { max = bond.getOrder(); } } if (max == null) { if (atom.getImplicitHydrogenCount() != null && atom.getImplicitHydrogenCount() > 0) max = Order.SINGLE; else max = Order.UNSET; } return max; }
/** * {@inheritDoc} */ @Override public Order getMinimumBondOrder(IAtom atom) { IBond.Order min = null; for (IBond bond : getAtomRef(atom).bonds()) { if (min == null || bond.getOrder().numeric() < min.numeric()) { min = bond.getOrder(); } } if (min == null) { if (atom.getImplicitHydrogenCount() != null && atom.getImplicitHydrogenCount() > 0) min = Order.SINGLE; else min = Order.UNSET; } return min; }
/** * {@inheritDoc} */ @Override public Order getMaximumBondOrder(IAtom atom) { IBond.Order max = null; for (IBond bond : getAtomRef(atom).bonds()) { if (max == null || bond.getOrder().numeric() > max.numeric()) { max = bond.getOrder(); } } if (max == null) { if (atom.getImplicitHydrogenCount() != null && atom.getImplicitHydrogenCount() > 0) max = Order.SINGLE; else max = Order.UNSET; } return max; }
private BaseAtomRef newAtomRef(IAtom atom) { // most common implementation we'll encounter.. if (atom.getClass() == Atom.class) return new BaseAtomRef(this, atom); atom = unbox(atom); // re-check the common case now we've un-boxed if (atom.getClass() == Atom.class) { return new BaseAtomRef(this, atom); } else if (atom instanceof IPseudoAtom) { return new PsuedoAtomRef(this, (IPseudoAtom) atom); } else if (atom instanceof IQueryAtom) { return new QueryAtomRef(this, (IQueryAtom) atom); } else if (atom instanceof IPDBAtom) { return new PdbAtomRef(this, (IPDBAtom) atom); } else { return new BaseAtomRef(this, atom); } }
/** * {@inheritDoc} */ @Override public void removeAtomOnly(int idx) { if (idx >= 0 && idx < numAtoms) { numAtoms--; for (int i = idx; i < numAtoms; i++) { atoms[i] = atoms[i + 1]; atoms[i].setIndex(i); } atoms[numAtoms] = null; } }
/** * {@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; }
/** * {@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; }
/** * {@inheritDoc} */ @Override public void removeAtomOnly(int idx) { if (idx >= 0 && idx < numAtoms) { numAtoms--; for (int i = idx; i < numAtoms; i++) { atoms[i] = atoms[i + 1]; atoms[i].setIndex(i); } atoms[numAtoms] = null; } }
@Override public int hashCode() { return deref().hashCode(); }
@Override public int hashCode() { return deref().hashCode(); }