Re: The Set Class in C++ and Java
- From: "coosa" <coosa76@xxxxxxxxx>
- Date: 3 Oct 2006 06:20:47 -0700
Kevin Spencer wrote:
any way, i have checked the file; it doesn't first implement generics
and doesn't really consider strong typing.
Any way; i really hope that Microsoft comes out with a Set
implementation in their future releases.
As an alternative, i see the HashTable, but considering a constantly
sorted range complexity of the tree, a HashTable is not always the
better choice since the fast lookup is what makes it very powerful.
The Java Set Interface is not strongly-typed either. In fact, it can contain
any combination of data in it, not just one type. See
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Set.html. I saw quite a
number of other C# Set Class implementations (see
http://www.google.com/search?hl=en&q=C%23+Set+Class), but the one that I
pointed you to was the closest one to the Java Set Interface, which I
thought was what you were looking for.
In any case, you are free to create your own Collection classes, derive from
any existing Collection class, and implement whatever functionality you
desire. Perhaps, considering your desire for strong typing, you might want
to start from one of the System.Collections.ObjectModel
(http://msdn2.microsoft.com/en-us/library/system.collections.objectmodel.aspx)
or System.Collections.Generic
(http://msdn2.microsoft.com/en-us/library/system.collections.generic.aspx)
namespace classes.
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
A watched clock never boils.
"coosa" <coosa76@xxxxxxxxx> wrote in message
news:1159724719.136866.127420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"coosa" <coosa76@xxxxxxxxx> wrote in message
news:1159702414.112222.83780@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear all,
I'm familiar with the Set Class in C++ and Java; however, i have
been
searching in C# for a similar container as in c++ or collection as
in
java, but couldn't find one.
Could some one tell me about the the Set implementation inside .NET?
Best regards
I believe the Set.cs link http://www.devhood.com/tools/myDownload is
broken
My bad, my mozilla firefox prevented the scripts for the page, so i
couldn't download it! :-)
any way, i have checked the file; it doesn't first implement generics
and doesn't really consider strong typing.
Any way; i really hope that Microsoft comes out with a Set
implementation in their future releases.
As an alternative, i see the HashTable, but considering a constantly
sorted range complexity of the tree, a HashTable is not always the
better choice since the fast lookup is what makes it very powerful.
That is not true at all,
Since JDK 1.5 Update 2, Java came up with alot of stong typed generics
including the vector , set, ...etc. classes.
Earlier you could not for instance use a statement in Java like this:
java.util.Vector <SomeClass> v; It took every thing as object and u
needed to cast. However, as from Update 2 i guess of 1.5 jdk, they
adapted the STL implementation of strong typing.
.
- References:
- The Set Class in C++ and Java
- From: coosa
- Re: The Set Class in C++ and Java
- From: Kevin Spencer
- Re: The Set Class in C++ and Java
- From: coosa
- Re: The Set Class in C++ and Java
- From: Kevin Spencer
- Re: The Set Class in C++ and Java
- From: coosa
- Re: The Set Class in C++ and Java
- From: Kevin Spencer
- The Set Class in C++ and Java
- Prev by Date: Re: Lock generic SortedList
- Next by Date: Re: The Set Class in C++ and Java
- Previous by thread: Re: The Set Class in C++ and Java
- Next by thread: Re: The Set Class in C++ and Java
- Index(es):
Relevant Pages
|