public virtual void Clear() { java.util.Iterator <V> i = Iterator(); while (i.HasNext()) { i.Next(); i.Remove(); } }
public virtual bool Remove(V o) { java.util.Iterator <V> i = Iterator(); while (i.HasNext()) { object e = i.Next(); if (o == null ? e == null : o.Equals(e)) { i.Remove(); return(true); } } return(false); }
public static bool RemoveIf(Collection <V> @this, java.util.function.Predicate predicate) { java.util.Iterator <V> i = @this.Iterator(); bool didremove = false; while (i.HasNext()) { object o = i.Next(); if (predicate.Test(o)) { didremove = true; i.Remove(); } } return(didremove); }
public virtual bool RemoveAll(Collection <V> c) { java.util.Iterator <V> i = Iterator(); bool didremove = false; while (i.HasNext()) { V o = i.Next(); if (c.Contains(o)) { didremove = true; i.Remove(); } } return(didremove); }