Download Latest Version netcfhashset-src-1.0.0.zip (24.5 kB)
Email in envelope

Get an email when there's a new version of .NET CF HashSet

Home / v1.0.0
Name Modified Size InfoDownloads / Week
Parent folder
HashSet-1.0.0.dll 2010-10-12 16.9 kB
netcfhashset-src-1.0.0.zip 2010-10-12 24.5 kB
README.md 2010-10-12 2.0 kB
Totals: 3 Items   43.4 kB 1

HashSet - HashSet implemetation which is missing in .NET CF

Click here for project page


License

Apache License 2.0

Summary

An implementation of HashSet class in .NET that can be used in .NET Compact Framework (.NET CF), in which it is natively missing A small .NET library providing a handful of useful Enum functions which are missing from the .NET Compact Framework (CF.NET).

Key Features

  • Parameterizable HashSet(Of T) implementation
  • Modeled after the Java SE java.util.HashSet<E> class

Usage

Examples of basic usage of a HashSet(Of String):

  1. Initialize a HashSet(Of String):

    Dim strHs = New HashSet(Of String)
    Assert.AreEqual(strHs.Count, 0)
    
  2. Add an element:

    Dim strHs = New HashSet(Of String)
    strHs.Add("first")
    Assert.IsTrue(strHs.Contains("first"))
    
  3. Remove an element:

    Dim strHs = New HashSet(Of String)
    strHs.Add("first")
    strHs.Remove("first")
    Assert.IsFalse(strHs.Contains("first"))
    
  4. Clear elements:

    Dim strHs = New HashSet(Of String)
    strHs.Add("first")
    strHs.Add("second")
    strHs.Add("third")
    Assert.AreEqual(strHs.Count, 3)
    strHs.Clear()
    Assert.AreEqual(strHs.Count, 0)
    
  5. Compare HashSets

    Dim strHs1 = New HashSet(Of String)
    strHs1.Add("first")
    strHs1.Add("second")
    strHs1.Add("third")
    Dim strHs2 = New HashSet(Of String)(strHs1)
    Assert.IsTrue(strHs1 = strHs2)
    strHs2.Remove("second")
    Assert.IsTrue(strHs1 <> strHs2)
    

How to Build

This library and associated unit tests were developed in VS 2008 as Smart Device projects.

Releases

  • 1.0
  • 2010-10-12
  • Initial release

Author:  Albert Ho <albertho -at- kdsecure.com>
Copyright: (c) 2010 by KD Secure, LLC
NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK.
Source: README.md, updated 2010-10-12