예제 #1
0
        public override bool RemoveAll(ICollection <E> collection)
        {
            bool result = false;

            if (Count <= collection.Count)
            {
                IIterator <E> it = Iterator();
                while (it.HasNext())
                {
                    if (collection.Contains(it.Next()))
                    {
                        it.Remove();
                        result = true;
                    }
                }
            }
            else
            {
                foreach (E e in collection)
                {
                    result = Remove(e) || result;
                }
            }
            return(result);
        }