/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
public void testRemoveAll() { setUpMutatorTest(); one.add("1"); two.add("2"); two.add("1"); c.addComposited(one, two); c.removeAll(one); assertTrue(!c.contains("1")); assertTrue(!one.contains("1")); assertTrue(!two.contains("1")); }
public void testRemove() { setUpMutatorTest(); one.add("1"); two.add("2"); two.add("1"); c.addComposited(one, two); c.remove("1"); assertTrue(!c.contains("1")); assertTrue(!one.contains("1")); assertTrue(!two.contains("1")); }
public void testIterator() { setUpTest(); one.add("1"); two.add("2"); c.addComposited(one); c.addComposited(two); Iterator i = c.iterator(); Object next = i.next(); assertTrue(c.contains(next)); assertTrue(one.contains(next)); next = i.next(); i.remove(); assertTrue(!c.contains(next)); assertTrue(!two.contains(next)); }
public void testRemoveComposited() { setUpMutatorTest(); one.add("1"); two.add("2"); two.add("1"); c.addComposited(one, two); c.removeComposited(one); assertTrue(c.contains("1")); assertEquals(c.size(), 2); } }
two.add("foo"); c.addAll(two); assertTrue(c.contains("foo")); assertTrue(one.contains("foo"));
assertTrue(c.contains("foo")); assertTrue(one.contains("foo"));
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }
/** * Checks whether this composite contains all the elements in the specified collection. * <p> * This implementation calls <code>contains()</code> for each element in the * specified collection. * * @param coll the collection to check for * @return true if all elements contained */ public boolean containsAll(Collection coll) { for (Iterator it = coll.iterator(); it.hasNext();) { if (this.contains(it.next()) == false) { return false; } } return true; }