示例#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);
        }
示例#2
0
        public override int GetHashCode()
        {
            int           result = 0;
            IIterator <E> it     = Iterator();

            while (it.HasNext())
            {
                Object next = it.Next();
                result += next == null ? 0 : next.GetHashCode();
            }
            return(result);
        }
示例#3
0
 public bool HasNext()
 {
     return(setIterator.HasNext());
 }