M
Mart
What class does everyone out there use if they want to store a set of values
efficiently?
In java I use a HashSet, but there is no equivalent in C#.
Even worse, the lowest level interface to define the Add, Contains and
Remove methods is an IList, and we all should know that a set isn't a list.
ICollection only defines Count and CopyTo, which isn't useful at all. So
even if I want to write my own Set implementation, what interface should I
implement?
There are literally dozens of features which make C# a better language than
java, but the collections framework is definitely a step backwards.
So, back to my original question, what does everyone else use? The easiest
solution is to use a Hashtable with null values, but that would have the
overhead of storing unnecessary DictionaryEntry objects.
Hope someone can enlighten me about the rational for this design
efficiently?
In java I use a HashSet, but there is no equivalent in C#.
Even worse, the lowest level interface to define the Add, Contains and
Remove methods is an IList, and we all should know that a set isn't a list.
ICollection only defines Count and CopyTo, which isn't useful at all. So
even if I want to write my own Set implementation, what interface should I
implement?
There are literally dozens of features which make C# a better language than
java, but the collections framework is definitely a step backwards.
So, back to my original question, what does everyone else use? The easiest
solution is to use a Hashtable with null values, but that would have the
overhead of storing unnecessary DictionaryEntry objects.
Hope someone can enlighten me about the rational for this design