SoftUni.Wintellect.PowerCollections 2.0.0

Install-Package SoftUni.Wintellect.PowerCollections -Version 2.0.0
dotnet add package SoftUni.Wintellect.PowerCollections --version 2.0.0
<PackageReference Include="SoftUni.Wintellect.PowerCollections" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoftUni.Wintellect.PowerCollections --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SoftUni.Wintellect.PowerCollections, 2.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoftUni.Wintellect.PowerCollections as a Cake Addin
#addin nuget:?package=SoftUni.Wintellect.PowerCollections&version=2.0.0

// Install SoftUni.Wintellect.PowerCollections as a Cake Tool
#tool nuget:?package=SoftUni.Wintellect.PowerCollections&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Getting Started

Install the NuGet package:

Install-Package SoftUni.Wintellect.PowerCollections

Import the namespace in your C# code:

using Wintellect.PowerCollections;

Wintellect.PowerCollections.Bag<T>: Example

Console.WriteLine("Bag<T> example:");
Bag<string> bag = new Bag<string>();
bag.Add("programming");
bag.Add("C#");
bag.Add("Visual Studio");
bag.Add("dotnet");
bag.Add("C#");
bag.Add("C#");
Console.WriteLine("Contains `dotnet`: {0}", bag.Contains("dotnet"));
Console.WriteLine("Deleted the first `C#` occurence: " + bag.Remove("C#"));
Console.WriteLine("Elements: {0}", bag);  

The above code will produce the following output:

Bag<T> example:
Contains `dotnet`: True
Deleted the first `C#` occurence: True
Elements: {dotnet,C#,C#,programming,Visual Studio}

Wintellect.PowerCollections.OrderedBag<T>: Example

Console.WriteLine("OrderedBag<T> example:");
OrderedBag<string> bag = new OrderedBag<string>();
bag.Add("programming");
bag.Add("C#");
bag.Add("Visual Studio");
bag.Add("dotnet");
bag.Add("C#");
bag.Add("C#");
Console.WriteLine("Contains `dotnet`: {0}", bag.Contains("dotnet"));
Console.WriteLine("Deleted the first `C#` occurence: " + bag.Remove("C#"));
Console.WriteLine("Elements: {0}", bag);
Console.WriteLine("Range[`d`...`q`]: {0}", bag.Range("d", true, "q", true));

The above code will produce the following output:

OrderedBag<T> example:
Contains `dotnet`: True
Deleted the first `C#` occurence: True
Elements: {C#,C#,dotnet,programming,Visual Studio}
Range[`d`...`q`]: {dotnet,programming}

Wintellect.PowerCollections.Set<T>: Example

Console.WriteLine("Set<T> example:");
Set<string> set = new Set<string>();
set.Add("programming");
set.Add("C#");
set.Add("Visual Studio");
set.Add("dotnet");
set.Add("C#");
set.Add("C#");
Console.WriteLine("Contains `dotnet`: {0}", set.Contains("dotnet"));
Console.WriteLine("Deleted the first `C#` occurence: " + set.Remove("C#"));

The above code will produce the following output:

Set<T> example:
Contains `dotnet`: True
Deleted the first `C#` occurence: True
Elements: {dotnet,programming,Visual Studio}

Wintellect.PowerCollections.OrderedSet<T>: Example

Console.WriteLine("OrderedSet<T> example:");
OrderedSet<string> set = new OrderedSet<string>();
set.Add("programming");
set.Add("C#");
set.Add("Visual Studio");
set.Add("dotnet");
set.Add("C#");
set.Add("C#");
Console.WriteLine("Contains `dotnet`: {0}", set.Contains("dotnet"));
Console.WriteLine("Deleted the first `C#` occurence: " + set.Remove("C#"));
Console.WriteLine("Elements: {0}", set);
Console.WriteLine("Range[`d`...`q`]: {0}", set.Range("d", true, "q", true));

The above code will produce the following output:

OrderedSet<T> example:
Contains `dotnet`: True
Deleted the first `C#` occurence: True
Elements: {dotnet,programming,Visual Studio}
Range[`d`...`q`]: {dotnet,programming}

Wintellect.PowerCollections.BigList<T>: Example

Console.WriteLine("BigList<T> example:");
BigList<string> list = new BigList<string>();
list.Add("programming");
list.Add("C#");
list.Add("Visual Studio");
list.Add("dotnet");
list.Add("C#");
list.Add("C#");
Console.WriteLine("Elements: {0}", list);
Console.WriteLine("Elements[2]: {0}", list[2]);
list.RemoveAt(2);
Console.WriteLine("Deleted list[2]");
list.Insert(1, "TypeScript");
Console.WriteLine("Added `TypeScript` at position 1");
Console.WriteLine("Elements: {0}", list);

The above code will produce the following output:

BigList<T> example:
Elements: {programming,C#,Visual Studio,dotnet,C#,C#}
Elements[2]: Visual Studio
Deleted list[2]
Added `TypeScript` at position 1
Elements: {programming,TypeScript,C#,dotnet,C#,C#}

Wintellect.PowerCollections.Deque<T>: Example

Console.WriteLine("Deque<T> example:");
Deque<string> list = new Deque<string>();
list.AddToBack("programming");
list.AddToBack("C#");
list.AddToFront("Visual Studio");
list.AddToBack("dotnet");
list.AddToFront("C#");
list.AddToBack("C#");
Console.WriteLine("Elements: {0}", list);
Console.WriteLine("Removed element from front: {0}", list.RemoveFromFront());
Console.WriteLine("Removed element from back: {0}", list.RemoveFromBack());
Console.WriteLine("Elements: {0}", list);

The above code will produce the following output:

Deque<T> example:
Elements: {C#,Visual Studio,programming,C#,dotnet,C#}
Removed element from front: C#
Removed element from back: C#
Elements: {Visual Studio,programming,C#,dotnet}

Wintellect.PowerCollections.MultiDictionary<K, V>: Example

Console.WriteLine("MultiDictionary<K, V> example:");
MultiDictionary<string, int> score = new MultiDictionary<string, int>(true);
score.Add("Peter", 5);
score.Add("Peter", 6);
score.Add("Peter", 6);
score.AddMany("Maria", new int[] { 5, 4, 5, 4, 6 });
score.AddMany("George", new int[] { 6, 6, 5, 5 });
Console.WriteLine("Elements: {0}", score);
Console.WriteLine("Removed element `Maria -> 4`: {0}", score.Remove("Maria", 4));
Console.WriteLine("Elements: {0}", score);

The above code will produce the following output:

MultiDictionary<K, V> example:
Elements: {Maria->(5,4,5,4,6), Peter->(5,6,6), George->(6,6,5,5)}
Removed element `Maria -> 4`: True
Elements: {Maria->(5,4,5,6), Peter->(5,6,6), George->(6,6,5,5)}

Wintellect.PowerCollections.OrderedDictionary<K, V>: Example

Console.WriteLine("OrderedDictionary<K, V> example:");
OrderedDictionary<string, double> ratings = new OrderedDictionary<string, double>();
ratings.Add("Peter", 8.5);
ratings.Add("Maria", 9.7);
ratings.Add("George", 7.6);
ratings.Add("Paula", 9.2);
ratings.Add("Steve", 7.7);
Console.WriteLine("Elements: {0}", ratings);
Console.WriteLine("Range[`k`...`r`]: {0}", ratings.Range("k", true, "r", true));
Console.WriteLine("Removed element `Maria`: {0}", ratings.Remove("Maria"));
Console.WriteLine("Elements: {0}", ratings);

The above code will produce the following output:

OrderedDictionary<K, V> example:
Elements: {George->7.6, Maria->9.7, Paula->9.2, Peter->8.5, Steve->7.7}
Range[`k`...`r`]: {Maria->9.7, Paula->9.2, Peter->8.5}
Removed element `Maria`: True
Elements: {George->7.6, Paula->9.2, Peter->8.5, Steve->7.7}

Wintellect.PowerCollections.OrderedMultiDictionary<K, V>: Example

Console.WriteLine("OrderedMultiDictionary<K, V> example:");
OrderedMultiDictionary<string, int> score = new OrderedMultiDictionary<string, int>(true);
score.Add("Peter", 5);
score.Add("Peter", 6);
score.Add("Peter", 6);
score.AddMany("Maria", new int[] { 5, 5, 4, 6 });
score.AddMany("George", new int[] { 6, 6, 5 });
score.AddMany("Paula", new int[] { 6, 6, 5, 6 });
score.AddMany("Steve", new int[] { 5, 6 });
Console.WriteLine("Elements: {0}", score);
Console.WriteLine("Removed element `Maria -> 4`: {0}", score.Remove("Maria", 4));
Console.WriteLine("Elements: {0}", score);
Console.WriteLine("Range[`k`...`r`]: {0}", score.Range("k", true, "r", true));

The above code will produce the following output:

OrderedMultiDictionary<K, V> example:
Elements: {George->(5,6,6), Maria->(4,5,5,6), Paula->(5,6,6,6), Peter->(5,6,6), Steve->(5,6)}
Removed element `Maria -> 4`: True
Elements: {George->(5,6,6), Maria->(5,5,6), Paula->(5,6,6,6), Peter->(5,6,6), Steve->(5,6)}
Range[`k`...`r`]: {Maria->(5,5,6), Paula->(5,6,6,6), Peter->(5,6,6)}
  • .NETFramework 2.0

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on SoftUni.Wintellect.PowerCollections:

Repository Stars
Pscx/Pscx
PowerShell Community Extensions module repository
Version Downloads Last updated
2.0.0 375 2/28/2021
1.1.5733.22550 6,093 9/12/2015
1.0.5731.26533 2,069 9/10/2015

This release supports the .NET Standard (.NET Core and .NET Framework).