Exemple #1
0
        public void TestAddAllAbsent()
        {
            CopyOnWriteArrayList <Object> full = PopulatedArray(3);
            ArrayList <Object>            v    = new ArrayList <Object>();

            v.Add(3);
            v.Add(4);
            v.Add(1); // will not Add this element
            full.AddAllAbsent(v);
            Assert.AreEqual(5, full.Size());
        }
 public override bool AddAll(Collection <E> c)
 {
     return(list.AddAllAbsent(c) > 0);
 }
 /// <summary>
 /// Creates a set containing all of the elements of the specified collection.
 /// </summary>
 public CopyOnWriteArraySet(Collection <E> c)
 {
     list = new CopyOnWriteArrayList <E>();
     list.AddAllAbsent(c);
 }