1 package uk.co.jezuk.mango.algorithms; 2 3 6 public class Remove 7 { 8 static public void execute(java.util.Iterator iterator, Object value) 9 { 10 if(iterator == null) 11 return; 12 13 while(iterator.hasNext()) 14 { 15 Object obj = iterator.next(); 16 if((value == null && obj == null) || value.equals(obj)) 17 iterator.remove(); 18 } } 21 private Remove() { } 22 } | Popular Tags |