Esempio n. 1
0
 public MiniEnumSetIterator(MiniEnumSet <E> outer)
 {
     this.outer      = outer;
     unProcessedBits = outer.bits;
     if (0 == unProcessedBits)
     {
         canProcess = false;
     }
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="collection"></param>
 /// <returns></returns>
 public override bool ContainsAll(ICollection <E> collection)
 {
     if (collection.Count == 0)
     {
         return(true);
     }
     if (collection is MiniEnumSet <E> )
     {
         MiniEnumSet <E> set = (MiniEnumSet <E>)collection;
         return(IsValidType(set.elementClass) && ((bits & set.bits) == set.bits));
     }
     return(!(collection is EnumSet <E>) && base.ContainsAll(collection));
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="collection"></param>
 /// <returns></returns>
 public override bool AddAll(ICollection <E> collection)
 {
     if (0 == collection.Count)
     {
         return(false);
     }
     if (collection is EnumSet <E> )
     {
         EnumSet <E> set = (EnumSet <E>)collection;
         if (!IsValidType(set.elementClass))
         {
             throw new Exception("ClassCastException");
         }
         MiniEnumSet <E> miniSet = (MiniEnumSet <E>)set;
         long            oldBits = bits;
         bits |= miniSet.bits;
         size  = Int64Helper.BitCount(bits);
         return(oldBits != bits);
     }
     return(base.AddAll(collection));
 }