public static void ForEach(Iterable <V> @this, java.util.function.Consumer consumer) { java.util.Iterator <V> i = @this.Iterator(); while (i.HasNext()) { consumer.Accept(i.Next()); } }
public virtual void Clear() { java.util.Iterator <V> i = Iterator(); while (i.HasNext()) { i.Next(); i.Remove(); } }
public static void ForEach(Map <K, V> @this, java.util.function.BiConsumer biconsumer) { java.util.Iterator <K> i = @this.KeySet().Iterator(); while (i.HasNext()) { K key = i.Next(); V value = @this.Get(key); biconsumer.Accept(key, value); } }
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); }