/** * Returns a vector of all rings that this atom is part of. * * @param atom The atom to be checked * @return A vector of all rings that this bond is part of */ @Override public IRingSet getRings(IAtom atom) { IRingSet rings = new RingSet(); IRing ring; for (int i = 0; i < getAtomContainerCount(); i++) { ring = (Ring) getAtomContainer(i); if (ring.contains(atom)) { rings.addAtomContainer(ring); } } return rings; }
/** {@inheritDoc} */ @Override public void add(IRingSet ringSet) { logger.debug("Adding ring set: ", ringSet); super.add(ringSet); }
/** * Checks for presence of a ring in this RingSet. * * @param ring The ring to check * @return true if ring is part of RingSet * */ @Override public boolean contains(IAtomContainer ring) { for (int i = 0; i < getAtomContainerCount(); i++) { if (ring == getAtomContainer(i)) { return true; } } return false; }
@Override public IChemObject newTestObject() { return new RingSet(); } });
/** * Adds all rings of another RingSet if they are not already part of this ring set. * * If you want to add a single ring to the set use {@link #addAtomContainer(org.openscience.cdk.interfaces.IAtomContainer)} * * @param ringSet the ring set to be united with this one. */ @Override public void add(IRingSet ringSet) { for (int f = 0; f < ringSet.getAtomContainerCount(); f++) { if (!contains(ringSet.getAtomContainer(f))) { addAtomContainer(ringSet.getAtomContainer(f)); } } }
/** {@inheritDoc} */ @Override public IRingSet getRings(IBond bond) { logger.debug("Getting rings for bond: ", bond); return super.getRings(bond); }
/** * Returns the String representation of this RingSet. * * @return The String representation of this RingSet */ @Override public String toString() { StringBuffer buffer = new StringBuffer(32); buffer.append("RingSet("); buffer.append(this.hashCode()); if (getAtomContainerCount() > 0) { buffer.append(", R=").append(getAtomContainerCount()).append(", "); for (int i = 0; i < atomContainerCount; i++) { IRing possibleRing = (IRing) atomContainers[i]; buffer.append(possibleRing.toString()); if (i + 1 < atomContainerCount) { buffer.append(", "); } } } buffer.append(')'); return buffer.toString(); }
clone.ringSet = (RingSet) ((RingSet) ringSet).clone(); } else { clone.ringSet = null;
/** {@inheritDoc} */ @Override public IRingSet getConnectedRings(IRing ring) { logger.debug("Getting connected rings for ring: ", ring); return super.getConnectedRings(ring); }
@BeforeClass public static void setUp() { setTestObjectBuilder(new ITestObjectBuilder() { @Override public IChemObject newTestObject() { return new RingSet(); } }); }
/** * Checks for presence of a ring in this RingSet. * * @param ring The ring to check * @return true if ring is part of RingSet * */ @Override public boolean contains(IAtomContainer ring) { for (int i = 0; i < getAtomContainerCount(); i++) { if (ring == getAtomContainer(i)) { return true; } } return false; }
/** * Adds all rings of another RingSet if they are not already part of this ring set. * * If you want to add a single ring to the set use {@link #addAtomContainer(org.openscience.cdk.interfaces.IAtomContainer)} * * @param ringSet the ring set to be united with this one. */ @Override public void add(IRingSet ringSet) { for (int f = 0; f < ringSet.getAtomContainerCount(); f++) { if (!contains(ringSet.getAtomContainer(f))) { addAtomContainer(ringSet.getAtomContainer(f)); } } }
/** {@inheritDoc} */ @Override public IRingSet getRings(IAtom atom) { logger.debug("Getting rings for atom: ", atom); return super.getRings(atom); }
/** * Returns the String representation of this RingSet. * * @return The String representation of this RingSet */ @Override public String toString() { StringBuffer buffer = new StringBuffer(32); buffer.append("RingSet("); buffer.append(this.hashCode()); if (getAtomContainerCount() > 0) { buffer.append(", R=").append(getAtomContainerCount()).append(", "); for (int i = 0; i < atomContainerCount; i++) { IRing possibleRing = (IRing) atomContainers[i]; buffer.append(possibleRing.toString()); if (i + 1 < atomContainerCount) { buffer.append(", "); } } } buffer.append(')'); return buffer.toString(); }
clone.ringSet = (RingSet) ((RingSet) ringSet).clone(); } else { clone.ringSet = null;
/** * Returns a vector of all rings that this atom is part of. * * @param atom The atom to be checked * @return A vector of all rings that this bond is part of */ @Override public IRingSet getRings(IAtom atom) { IRingSet rings = new RingSet(); IRing ring; for (int i = 0; i < getAtomContainerCount(); i++) { ring = (Ring) getAtomContainer(i); if (ring.contains(atom)) { rings.addAtomContainer(ring); } } return rings; }
@Test public void testRingSet() { IRingSet rs = new RingSet(); Assert.assertNotNull(rs); }
/** * True, if at least one of the rings in the ringset contains * the given atom. * * @param atom Atom to check * @return true, if the ringset contains the atom */ @Override public boolean contains(IAtom atom) { for (int i = 0; i < getAtomContainerCount(); i++) { if (getAtomContainer(i).contains(atom)) { return true; } } return false; }