Trarizon.Library.Collections
1.0.1
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
dotnet add package Trarizon.Library.Collections --version 1.0.1
NuGet\Install-Package Trarizon.Library.Collections -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trarizon.Library.Collections" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trarizon.Library.Collections" Version="1.0.1" />
<PackageReference Include="Trarizon.Library.Collections" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Trarizon.Library.Collections --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Trarizon.Library.Collections, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Trarizon.Library.Collections@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Trarizon.Library.Collections&version=1.0.1
#tool nuget:?package=Trarizon.Library.Collections&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Trarizon.Library.Collections
Collections types, helpers for BCL collections and related types, more linqs
Table of Contents
- Collection types
- Collection helpers
- Other helpers : Helper for comparision,
Index,Range... - Linq
Collection types
AllocOpt |
Collections |
|---|---|
AllocOptList |
Value type list using pooled array as underlying array |
Buffers |
summary |
|---|---|
IArrayAllocator |
Abstraction for array allocation and release |
NativeArray |
Unmanaged array |
Generic |
General generic types |
|---|---|
BinaryTree<> |
Binary Tree |
Deque<> |
Double-ended queue |
IBinaryTreeNode<> <br/> BinaryTreeNode |
Abstraction for binary tree node |
ILinkedListNode<> <br/> LinkedListNode |
Abstraction for linked list node |
ListDictionary<,> |
Dictionary search by linear |
Memento<> |
General memento collection, Ring queue with an active pointer |
PrefixTree<> |
General prefix tree |
PrefixTreeDictionary<,> |
Dictionary implemented with prefix tree |
RingQueue<> |
Ring queue, a queue with fixed max size |
SortedList<> |
List that automatically sort item when adding |
StackAlloc |
Ref struct types |
|---|---|
(ReadOnly)ConcatSpan<> |
Concat 2 (ReadOnly)Span<>s |
(ReadOnly)ReversedSpan<> |
Reversed (ReadOnly)Span<> |
StackAllocBitArray |
Bit array, use Span<uint> as underlying array |
Collection Helpers
Static class with Tra prefix,
Algorithm |
Algorithm provider |
|---|---|
LinearSearch |
|
InsertionSort |
|
BubbleSort |
|
LevenshteinDistance |
Span |
For Span<> and ReadOnlySpan<> |
|---|---|
TryAt |
|
AsReversed |
Create ReversedSpan from Span |
static As(ReadOnly)Bytes |
Create Span from a unmanaged value |
MoveTo |
Move items on fromIndex to toIndex |
FindLower(Upper)BoundIndex |
Find lower/upper bound in a sorted span |
OffsetOf |
Get index of a ref |
LinearSearch |
|
| Overloads for BCL exts | Contains, Find, FindIndex |
Array |
For T[] and ImmutableArray<> |
|---|---|
EmptyIfDefault |
Convert to empty array if ImmutableArray<> is default |
AsEnumerable(OrNull) |
Convert ImmutableyArray<> to IEnumerable<> avoiding boxing |
Collection |
For BCL collections like List<>, Dictionary<,> |
|---|---|
Singleton(T) |
Return a struct list wrapper with only one element |
Dict<,>.AtRef |
Get Value ref from Dictionary<,> or throw |
IDict.GetOrAdd |
|
IDict.AddOrUpdate |
|
AsSpan(Stack<>) |
Get ReversedSpan of a Stack<> |
AsSpan(List<>) |
Equivalent to CollectionsMarshal.AsSpan(), for .NET standard |
List<>.AtRef |
Get value ref |
overload List<>.AddRange |
Overload with ReadOnlySpan<> |
| overloads | RemoveAt RemoveRange with Index/Range |
List<>.MoveTo |
see TraSpan.MoveTo |
List<>.ReplaceAll |
Replace items in list |
List<>.GetLookup |
Get lookup wrapper for search |
List<>.GetSortedModifier |
Get sorted modifier, with which modifying list keeps list elements in order |
Helpers
Comparison |
Helpers for comparison |
|---|---|
IComparer.Reverse |
Reverse comparer |
static CreateComparable |
Create IComparable<> by |
static CreateEquatable |
Create IEquatable<> |
Index |
Helpers for Index/Range or int as index |
|---|---|
static FlipNegative |
Flip negative int value, use for handle return value of Searches |
Index.GetCheckedOffset |
|
Range.GetStartAndEndOffset |
|
Range.GetCheckedStartAndEndOffset |
|
static ValidateSliceArgs |
Linq
Linq extensions, in class TraEnumerable
- Aggregation
CountsMoreThan/LessThan/AtMost/AtLeast/EqualsTo/Between: Judge size of collectionIsDistinct(By): Check if the collection doesn't contains duplicate elementIsInOrder(By): Check if the elements in collection is in orderMinMax(By): Get minimun value and maximun value in one iteration
- Creation
EnumerateByWhile/NotNull: Yield next value selected by aFunc<T, T>, until predicate failedEnumerateDescendantsDepth/BreadthFirst: Traverse tree
- Element
TryAt:TryXXXversion ofElementAtTryFirst:TryXXXversion ofFirstTryLast:TryXXXversion ofLastFirstNearToMax(By)(OrDefault): Find the first item has priority greater than given priority, if not found, return the first item with greatest priorityTrySingle: Returning tagged union version ofSingle
- Filtering
Duplicates: Return all elements that is not distinct in collectionOfNotNull: Filter out allnullvaluesTakeEvery: Yield the values in specific interval
- Joining
CatesianProduct: Catesian productInterleave: Alternates elements from each source.Merge: Merge 2 sorted collections
- Mapping
Adjacent: Yield the value and its next valueAggregateSelect:Aggregateand returns all values in processingChunkPair/Triple: Returning tuple version ofChunkChunkBy: Similiar tostring.SplitWithIndex: Yield return index and item,Indexin .NET 9Intersperse: Inserts the specified separator between each element of the source sequence.Repeat: Repeatly enumerate the collectionRepeatInterleave: Repeat item in sequence
- Partition
OfTypeWhile: Take values until doesn't match the given typeOfTypeUntil: Take values until reach element in given typePopFront: Split the collection into 2 parts, the first parts is return byoutparamterPopFirst: Get the first element, and returns the rest elements.
- Sorting
LazyReverse: Reverse, no cache if source isIList<T>Rotate: Split the collection into 2 parts and swap them
- ToCollections
ForEachEmptyIfNull: Return empty collection if source collection isnullTryToNonEmptyList: If collection is not empty, then collect items intoList<>, in one iteration
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Bcl.Memory (>= 9.0.4)
- System.Collections.Immutable (>= 8.0.0)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
.NETStandard 2.1
- System.Collections.Immutable (>= 8.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Trarizon.Library.Collections:
| Package | Downloads |
|---|---|
|
Trarizon.Library
Trarizon's personal library |
GitHub repositories
This package is not used by any popular GitHub repositories.