private UserDefinedSetCollection CreateNewSet(string name) { UserDefinedSetCollection created = new UserDefinedSetCollection(elements.Count); elements.Add(name); return(created); }
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); }
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)); }
public bool ProperlyInclude(UserDefinedSetCollection included) { return((new BitArray(collection)).Not().And(included.collection).OfType <bool>().All(u => !u)); }
public UserDefinedSetCollection Sub(UserDefinedSetCollection another) { return(new UserDefinedSetCollection(new BitArray(another.collection).Not().And(collection))); }
public UserDefinedSetCollection Union(UserDefinedSetCollection another) { return(new UserDefinedSetCollection((new BitArray(collection)).Or(another.collection))); }
public UserDefinedSetCollection Intersect(UserDefinedSetCollection another) { return(new UserDefinedSetCollection((new BitArray(collection)).And(another.collection))); }
public void Expend(UserDefinedSetCollection another) { collection.Or(another.collection); }