/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
public void testClear() { assertEquals(0,list.size()); assertTrue(list.isEmpty()); list.clear(); assertEquals(0,list.size()); assertTrue(list.isEmpty()); list.add("element"); assertEquals(1,list.size()); assertTrue(!list.isEmpty()); list.clear(); assertEquals(0,list.size()); assertTrue(list.isEmpty()); list.add("element1"); list.add("element2"); assertEquals(2,list.size()); assertTrue(!list.isEmpty()); list.clear(); assertEquals(0,list.size()); assertTrue(list.isEmpty()); for(int i=0;i<1000;i++) { list.add(new Integer(i)); } assertEquals(1000,list.size()); assertTrue(!list.isEmpty()); list.clear(); assertEquals(0,list.size()); assertTrue(list.isEmpty()); }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }
/** * Removes all nodes by iteration. */ protected void removeAllNodes() { if (size() > 0) { // superclass implementation would break all the iterators Iterator it = iterator(); while (it.hasNext()) { it.next(); it.remove(); } } }