示例#1
0
        private UserDefinedSetCollection CreateNewSet(string name)
        {
            UserDefinedSetCollection created = new UserDefinedSetCollection(elements.Count);

            elements.Add(name);
            return(created);
        }
示例#2
0
        public UserDefinedSetCollection FindSet(string name)
        {
            UserDefinedSetCollection set = null;
            bool exist = defindedSets.TryGetValue(name, out set);

            if (!exist)
            {
                set = CreateNewSet(name);
                defindedSets.Add(name, set);
            }
            return(set);
        }
示例#3
0
 public bool Include(UserDefinedSetCollection included)
 {
     /*if (levelCount < included.levelCount)
      * {
      *  return false;
      * }
      * int level = levelCount;
      * Level includingLevel = topLevel;
      * Level includedLevel = included.topLevel;
      * while (level > included.levelCount)
      * {
      *  includingLevel = includingLevel.SubLevel[0];
      *  if (includingLevel == null)
      *  {
      *      return false;
      *  }
      *  --level;
      * }*/
     return((new BitArray(collection)).Not().And(included.collection).OfType <bool>().All(u => !u));
 }
示例#4
0
 public bool ProperlyInclude(UserDefinedSetCollection included)
 {
     return((new BitArray(collection)).Not().And(included.collection).OfType <bool>().All(u => !u));
 }
示例#5
0
 public UserDefinedSetCollection Sub(UserDefinedSetCollection another)
 {
     return(new UserDefinedSetCollection(new BitArray(another.collection).Not().And(collection)));
 }
示例#6
0
 public UserDefinedSetCollection Union(UserDefinedSetCollection another)
 {
     return(new UserDefinedSetCollection((new BitArray(collection)).Or(another.collection)));
 }
示例#7
0
 public UserDefinedSetCollection Intersect(UserDefinedSetCollection another)
 {
     return(new UserDefinedSetCollection((new BitArray(collection)).And(another.collection)));
 }
示例#8
0
 public void Expend(UserDefinedSetCollection another)
 {
     collection.Or(another.collection);
 }