Exemple #1
0
 public virtual void Clear()
 {
     java.util.Iterator <V> i = Iterator();
     while (i.HasNext())
     {
         i.Next();
         i.Remove();
     }
 }
Exemple #2
0
 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);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }