/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
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)); }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }
/** * Returns an array containing all of the elements in this composite. * * @return an object array of all the elements in the collection */ public Object[] toArray() { final Object[] result = new Object[this.size()]; int i = 0; for (Iterator it = this.iterator(); it.hasNext(); i++) { result[i] = it.next(); } return result; }