Re: The Set Class in C++ and Java




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.

.



Relevant Pages

  • Re: Python or Java or maybe PHP?
    ... C#'s pretty close to Java, typing-wise, and C++'s not that far away. ... Runtime typing is enabled, as a productive programming approach, by the ... you code something like (in Python ... Once you've decided to give dynamic-typing languages a try, ...
    (comp.lang.python)
  • Re: The Set Class in C++ and Java
    ... Kevin Spencer wrote: ... i really hope that Microsoft comes out with a Set ... The Java Set Interface is not strongly-typed either. ... Perhaps, considering your desire for strong typing, you might want ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: The Set Class in C++ and Java
    ... Kevin Spencer wrote: ... and doesn't really consider strong typing. ... i really hope that Microsoft comes out with a Set ... The Java Set Interface is not strongly-typed either. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why we should (not?) have closures after all
    ... most of which Java programmers learn to skim over ... typing, if you really want it, without requiring so much text. ... The question is whether you want the compiler to catch type errors (of ... course), or whether you want the programmer to see them. ...
    (comp.lang.java.programmer)
  • Re: What the hell is C-Sharp?
    ... > opposed to Java for websites is that it is SO easy to knock websites ... Strong typing and compilation mean you can erradicate SO many ... > PHP is great due to flexibility, ease, speed and support. ...
    (comp.lang.php)