.Net 集合类

来源:互联网 发布:spss软件 编辑:程序博客网 时间:2024/05/21 14:36

.Net 类库里没有集合类的吗?

自己写了个,大家提提意见~~

using System;
using System.Collections;

namespace CN.Teddy.Util.Collections
{
    
/// <summary>
    
/// ISimpleSet 的摘要说明。
    
/// </summary>

    public interface ISimpleSet : ICollection, ICloneable
    
{
        
bool Contains(object obj);

        
bool BelongTo(SimpleSet set2);

        
void Add(object obj);

        
void Remove(object obj);

        
void Clear();

        SimpleSet Intersect(SimpleSet set2);

        SimpleSet Union(SimpleSet set2);

        SimpleSet Minus(SimpleSet set2);
    }

}


using System;
using System.Collections;

namespace CN.Teddy.Util.Collections
{
    
/// <summary>
    
/// SimpleSet 的摘要说明。
    
/// </summary>

    public class SimpleSet : ISimpleSet
    
{
        
Private members

        
Public Members

        
Constructors

        
ICollection 成员

        
IEnumerable 成员

        
ISimpleSet 成员

        
ICloneable 成员
    }

}


using System;

namespace CN.Teddy.Util.Collections
{
    
/// <summary>
    
/// IEqualHandler 的摘要说明。
    
/// </summary>

    public interface IEqualHandler
    
{
        
bool Equal(object obj1, object obj2);
    }

}


using System;

namespace CN.Teddy.Util.Collections
{
    
/// <summary>
    
/// EqualHandler 的摘要说明。
    
/// </summary>

    public class EqualHandler : IEqualHandler
    
{
        
IEqualHandler 成员
    }

}