diff --git a/404.html b/404.html index ca89fd7..4e3a9c5 100644 --- a/404.html +++ b/404.html @@ -4,13 +4,13 @@ Page Not Found | Extended.Collections - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/__docusaurus/debug.html b/__docusaurus/debug.html index 81013db..af3b86f 100644 --- a/__docusaurus/debug.html +++ b/__docusaurus/debug.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Site config

- + \ No newline at end of file diff --git a/__docusaurus/debug/config.html b/__docusaurus/debug/config.html index 28ceb69..e0e7171 100644 --- a/__docusaurus/debug/config.html +++ b/__docusaurus/debug/config.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Site config

- + \ No newline at end of file diff --git a/__docusaurus/debug/content.html b/__docusaurus/debug/content.html index 03f13f9..339e052 100644 --- a/__docusaurus/debug/content.html +++ b/__docusaurus/debug/content.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Plugin content

docusaurus-plugin-content-docs

default
- + \ No newline at end of file diff --git a/__docusaurus/debug/globalData.html b/__docusaurus/debug/globalData.html index c6acaba..6c75e81 100644 --- a/__docusaurus/debug/globalData.html +++ b/__docusaurus/debug/globalData.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Global data

- + \ No newline at end of file diff --git a/__docusaurus/debug/metadata.html b/__docusaurus/debug/metadata.html index 0fc96f1..6407aea 100644 --- a/__docusaurus/debug/metadata.html +++ b/__docusaurus/debug/metadata.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Site Metadata

Docusaurus Version: 2.4.1
Site Version: 0.0.0

Plugins and themes

  • 2.4.1
    docusaurus-plugin-debug
    Type: package
  • 2.4.1
    docusaurus-theme-classic
    Type: package
  • 2.4.1
    docusaurus-plugin-sitemap
    Type: package
  • 2.4.1
    docusaurus-plugin-content-docs
    Type: package
- + \ No newline at end of file diff --git a/__docusaurus/debug/registry.html b/__docusaurus/debug/registry.html index 4ecf87c..cafce1a 100644 --- a/__docusaurus/debug/registry.html +++ b/__docusaurus/debug/registry.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Registry

  • Aliased Path: @theme/DocItem
    Resolved Path: 9714
  • Aliased Path: /home/runner/work/Extended.Collections/Extended.Collections/docusaurus/.docusaurus/docusaurus-plugin-debug/default/plugin-route-context-module-100.json
    Resolved Path: 3984
  • Aliased Path: @theme/DocPage
    Resolved Path: 1551
  • Aliased Path: @site/../documentation/generic/specialized/ordered_dictionary.md
    Resolved Path: 1245
  • Aliased Path: @theme/DebugConfig
    Resolved Path: 6074
  • Aliased Path: ~debug/default/docusaurus-debug-all-content-673.json
    Resolved Path: 6267
  • Aliased Path: @site/../documentation/generic/ring_buffer.md
    Resolved Path: 5381
  • Aliased Path: @theme/DebugRegistry
    Resolved Path: 8165
  • Aliased Path: @theme/DebugSiteMetadata
    Resolved Path: 3767
  • Aliased Path: @site/../documentation/index.md
    Resolved Path: 9068
  • Aliased Path: ~docs/default/version-current-metadata-prop-751.json
    Resolved Path: 1109
  • Aliased Path: @theme/DebugRoutes
    Resolved Path: 7327
  • Aliased Path: @theme/DebugContent
    Resolved Path: 793
  • Aliased Path: /home/runner/work/Extended.Collections/Extended.Collections/docusaurus/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json
    Resolved Path: 3769
  • Aliased Path: @theme/DebugGlobalData
    Resolved Path: 2507
- + \ No newline at end of file diff --git a/__docusaurus/debug/routes.html b/__docusaurus/debug/routes.html index 0299c5c..5710af9 100644 --- a/__docusaurus/debug/routes.html +++ b/__docusaurus/debug/routes.html @@ -4,13 +4,13 @@ Docusaurus debug panel - +

Routes

  • /Extended.Collections/__docusaurus/debug
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/config
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/content
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/globalData
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/metadata
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/registry
    Is exact: true
  • /Extended.Collections/__docusaurus/debug/routes
    Is exact: true
  • /Extended.Collections/
    Is exact: false
    Child Routes:
  • *
    Is exact: false
- + \ No newline at end of file diff --git a/assets/js/1f958b60.258004ec.js b/assets/js/1f958b60.e5718319.js similarity index 98% rename from assets/js/1f958b60.258004ec.js rename to assets/js/1f958b60.e5718319.js index 06871d8..b0f9164 100644 --- a/assets/js/1f958b60.258004ec.js +++ b/assets/js/1f958b60.e5718319.js @@ -1 +1 @@ -"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[333],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=r.createContext({}),l=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=l(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},y=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=l(n),y=i,m=p["".concat(c,".").concat(y)]||p[y]||u[y]||a;return n?r.createElement(m,o(o({ref:t},d),{},{components:n})):r.createElement(m,o({ref:t},d))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=y;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var r=n(7462),i=(n(7294),n(3905));const a={},o="Ordered Dictionary",s={unversionedId:"generic/specialized/ordered_dictionary",id:"generic/specialized/ordered_dictionary",title:"Ordered Dictionary",description:"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.",source:"@site/../documentation/generic/specialized/ordered_dictionary.md",sourceDirName:"generic/specialized",slug:"/generic/specialized/ordered_dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/specialized/ordered_dictionary.md",tags:[],version:"current",lastUpdatedAt:1694569887,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{},sidebar:"defaultSidebar",previous:{title:"Introduction",permalink:"/Extended.Collections/"},next:{title:"Ring Buffer",permalink:"/Extended.Collections/generic/ring_buffer"}},c={},l=[{value:"Hypothetical Use Case:",id:"hypothetical-use-case",level:3}],d={toc:l},p="wrapper";function u(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"ordered-dictionary"},"Ordered Dictionary"),(0,i.kt)("p",null,"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys. "),(0,i.kt)("p",null,"Pros:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Maintains the order of key-value pairs, which can be useful for scenarios where the order of insertion or access is important."),(0,i.kt)("li",{parentName:"ul"},"Provides the functionality of a dictionary, allowing for fast key-based lookups."),(0,i.kt)("li",{parentName:"ul"},"Supports generic TKey and TValue types, making it flexible for various data types.")),(0,i.kt)("p",null,"Cons:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Slightly higher memory usage compared to a regular dictionary due to the need to store the order of items."),(0,i.kt)("li",{parentName:"ul"},"Some operations may be slower compared to a regular dictionary due to maintaining the order.")),(0,i.kt)("h3",{id:"hypothetical-use-case"},"Hypothetical Use Case:"),(0,i.kt)("p",null,"Suppose you are building a task management application, and you need to maintain a list of tasks for a project while preserving the order in which they were added. An OrderedDictionary can be useful in this scenario to store and manage tasks associated with a project."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-csharp",metastring:"file=../../../src/Extended.Collections.Playground/Generic/Specialized/OrderedDictionarySandbox.cs#L2-",file:"../../../src/Extended.Collections.Playground/Generic/Specialized/OrderedDictionarySandbox.cs#L2-"},'using System.Collections;\n\nnamespace Extended.Collections.Playground.Generic.Specialized;\n\npublic class OrderedDictionarySandbox : Sandbox\n{\n private OrderedDictionary m_tasks = new ();\n\n protected override void Run()\n {\n // Add tasks to the project in a specific order.\n m_tasks.Add("Task1", "Complete research");\n m_tasks.Add("Task2", "Write documentation");\n m_tasks.Add("Task3", "Test functionality");\n\n // Access tasks by their keys while maintaining their order.\n Console.WriteLine("Project Tasks:");\n foreach (KeyValuePair entry in m_tasks)\n {\n Console.WriteLine($"TaskId: {entry.Key}");\n Console.WriteLine($"Name:{entry.Value}");\n }\n\n // Remove \n m_tasks.RemoveAt(1); // Remove by index\n m_tasks.Remove("Task1"); // Remove by key \n\n Logger.Information("Value: {Value}", m_tasks);\n // 1. [ \'Task2\' ] = "Write documentation"\n // 2. [ \'Task3\' ] = "Test functionality"\n }\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[333],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>m});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=r.createContext({}),l=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=l(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},y=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=l(n),y=i,m=p["".concat(c,".").concat(y)]||p[y]||u[y]||a;return n?r.createElement(m,o(o({ref:t},d),{},{components:n})):r.createElement(m,o({ref:t},d))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=y;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[p]="string"==typeof e?e:i,o[1]=s;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var r=n(7462),i=(n(7294),n(3905));const a={},o="Ordered Dictionary",s={unversionedId:"generic/specialized/ordered_dictionary",id:"generic/specialized/ordered_dictionary",title:"Ordered Dictionary",description:"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.",source:"@site/../documentation/generic/specialized/ordered_dictionary.md",sourceDirName:"generic/specialized",slug:"/generic/specialized/ordered_dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/specialized/ordered_dictionary.md",tags:[],version:"current",lastUpdatedAt:1694570076,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{},sidebar:"defaultSidebar",previous:{title:"Introduction",permalink:"/Extended.Collections/"},next:{title:"Ring Buffer",permalink:"/Extended.Collections/generic/ring_buffer"}},c={},l=[{value:"Hypothetical Use Case:",id:"hypothetical-use-case",level:3}],d={toc:l},p="wrapper";function u(e){let{components:t,...n}=e;return(0,i.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"ordered-dictionary"},"Ordered Dictionary"),(0,i.kt)("p",null,"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys. "),(0,i.kt)("p",null,"Pros:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Maintains the order of key-value pairs, which can be useful for scenarios where the order of insertion or access is important."),(0,i.kt)("li",{parentName:"ul"},"Provides the functionality of a dictionary, allowing for fast key-based lookups."),(0,i.kt)("li",{parentName:"ul"},"Supports generic TKey and TValue types, making it flexible for various data types.")),(0,i.kt)("p",null,"Cons:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Slightly higher memory usage compared to a regular dictionary due to the need to store the order of items."),(0,i.kt)("li",{parentName:"ul"},"Some operations may be slower compared to a regular dictionary due to maintaining the order.")),(0,i.kt)("h3",{id:"hypothetical-use-case"},"Hypothetical Use Case:"),(0,i.kt)("p",null,"Suppose you are building a task management application, and you need to maintain a list of tasks for a project while preserving the order in which they were added. An OrderedDictionary can be useful in this scenario to store and manage tasks associated with a project."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-csharp",metastring:"file=../../../src/Extended.Collections.Playground/Generic/Specialized/OrderedDictionarySandbox.cs#L2-",file:"../../../src/Extended.Collections.Playground/Generic/Specialized/OrderedDictionarySandbox.cs#L2-"},'using System.Collections;\n\nnamespace Extended.Collections.Playground.Generic.Specialized;\n\npublic class OrderedDictionarySandbox : Sandbox\n{\n private OrderedDictionary m_tasks = new ();\n\n protected override void Run()\n {\n // Add tasks to the project in a specific order.\n m_tasks.Add("Task1", "Complete research");\n m_tasks.Add("Task2", "Write documentation");\n m_tasks.Add("Task3", "Test functionality");\n\n // Access tasks by their keys while maintaining their order.\n Console.WriteLine("Project Tasks:");\n foreach (KeyValuePair entry in m_tasks)\n {\n Console.WriteLine($"TaskId: {entry.Key}");\n Console.WriteLine($"Name:{entry.Value}");\n }\n\n // Remove \n m_tasks.RemoveAt(1); // Remove by index\n m_tasks.Remove("Task1"); // Remove by key \n\n Logger.Information("Value: {Value}", m_tasks);\n // 1. [ \'Task2\' ] = "Write documentation"\n // 2. [ \'Task3\' ] = "Test functionality"\n }\n}\n')))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/246f2c6f.02c64550.js b/assets/js/246f2c6f.e855fb24.js similarity index 93% rename from assets/js/246f2c6f.02c64550.js rename to assets/js/246f2c6f.e855fb24.js index c45bb20..c351f55 100644 --- a/assets/js/246f2c6f.02c64550.js +++ b/assets/js/246f2c6f.e855fb24.js @@ -1 +1 @@ -"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[285],{6267:e=>{e.exports=JSON.parse('{"docusaurus-plugin-debug":{},"docusaurus-theme-classic":{},"docusaurus-plugin-sitemap":{},"docusaurus-plugin-content-docs":{"default":{"loadedVersions":[{"versionName":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","path":"/Extended.Collections/","tagsPath":"/Extended.Collections/tags","isLast":true,"routePriority":-1,"contentPath":"/home/runner/work/Extended.Collections/Extended.Collections/documentation","contentPathLocalized":"/home/runner/work/Extended.Collections/Extended.Collections/docusaurus/i18n/en/docusaurus-plugin-content-docs/current","docs":[{"unversionedId":"generic/ring_buffer","id":"generic/ring_buffer","title":"Ring Buffer","description":"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.","source":"@site/../documentation/generic/ring_buffer.md","sourceDirName":"generic","slug":"/generic/ring_buffer","permalink":"/Extended.Collections/generic/ring_buffer","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/ring_buffer.md","tags":[],"version":"current","lastUpdatedAt":1694569887,"formattedLastUpdatedAt":"Sep 13, 2023","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Ordered Dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary"}},{"unversionedId":"generic/specialized/ordered_dictionary","id":"generic/specialized/ordered_dictionary","title":"Ordered Dictionary","description":"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.","source":"@site/../documentation/generic/specialized/ordered_dictionary.md","sourceDirName":"generic/specialized","slug":"/generic/specialized/ordered_dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/specialized/ordered_dictionary.md","tags":[],"version":"current","lastUpdatedAt":1694569887,"formattedLastUpdatedAt":"Sep 13, 2023","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Introduction","permalink":"/Extended.Collections/"},"next":{"title":"Ring Buffer","permalink":"/Extended.Collections/generic/ring_buffer"}},{"unversionedId":"index","id":"index","title":"Introduction","description":"Collections Extended a zero dependency netstandard library that contains an array of different generic collections to use in any application. Each collection has it\'s own use","source":"@site/../documentation/index.md","sourceDirName":".","slug":"/","permalink":"/Extended.Collections/","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/index.md","tags":[],"version":"current","lastUpdatedAt":1694569887,"formattedLastUpdatedAt":"Sep 13, 2023","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"defaultSidebar","next":{"title":"Ordered Dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary"}}],"drafts":[],"sidebars":{"defaultSidebar":[{"type":"doc","id":"index"},{"type":"category","label":"Generic","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Specialized","collapsible":true,"collapsed":true,"items":[{"type":"doc","id":"generic/specialized/ordered_dictionary"}]},{"type":"doc","id":"generic/ring_buffer"}]}]}}]}},"docusaurus-bootstrap-plugin":{},"docusaurus-mdx-fallback-plugin":{}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[285],{6267:e=>{e.exports=JSON.parse('{"docusaurus-plugin-debug":{},"docusaurus-theme-classic":{},"docusaurus-plugin-sitemap":{},"docusaurus-plugin-content-docs":{"default":{"loadedVersions":[{"versionName":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","path":"/Extended.Collections/","tagsPath":"/Extended.Collections/tags","isLast":true,"routePriority":-1,"contentPath":"/home/runner/work/Extended.Collections/Extended.Collections/documentation","contentPathLocalized":"/home/runner/work/Extended.Collections/Extended.Collections/docusaurus/i18n/en/docusaurus-plugin-content-docs/current","docs":[{"unversionedId":"generic/ring_buffer","id":"generic/ring_buffer","title":"Ring Buffer","description":"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.","source":"@site/../documentation/generic/ring_buffer.md","sourceDirName":"generic","slug":"/generic/ring_buffer","permalink":"/Extended.Collections/generic/ring_buffer","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/ring_buffer.md","tags":[],"version":"current","lastUpdatedAt":1694570076,"formattedLastUpdatedAt":"Sep 13, 2023","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Ordered Dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary"}},{"unversionedId":"generic/specialized/ordered_dictionary","id":"generic/specialized/ordered_dictionary","title":"Ordered Dictionary","description":"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.","source":"@site/../documentation/generic/specialized/ordered_dictionary.md","sourceDirName":"generic/specialized","slug":"/generic/specialized/ordered_dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/specialized/ordered_dictionary.md","tags":[],"version":"current","lastUpdatedAt":1694570076,"formattedLastUpdatedAt":"Sep 13, 2023","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Introduction","permalink":"/Extended.Collections/"},"next":{"title":"Ring Buffer","permalink":"/Extended.Collections/generic/ring_buffer"}},{"unversionedId":"index","id":"index","title":"Introduction","description":"Collections Extended a zero dependency netstandard library that contains an array of different generic collections to use in any application. Each collection has it\'s own use","source":"@site/../documentation/index.md","sourceDirName":".","slug":"/","permalink":"/Extended.Collections/","draft":false,"editUrl":"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/index.md","tags":[],"version":"current","lastUpdatedAt":1694570076,"formattedLastUpdatedAt":"Sep 13, 2023","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"defaultSidebar","next":{"title":"Ordered Dictionary","permalink":"/Extended.Collections/generic/specialized/ordered_dictionary"}}],"drafts":[],"sidebars":{"defaultSidebar":[{"type":"doc","id":"index"},{"type":"category","label":"Generic","collapsible":true,"collapsed":true,"items":[{"type":"category","label":"Specialized","collapsible":true,"collapsed":true,"items":[{"type":"doc","id":"generic/specialized/ordered_dictionary"}]},{"type":"doc","id":"generic/ring_buffer"}]}]}}]}},"docusaurus-bootstrap-plugin":{},"docusaurus-mdx-fallback-plugin":{}}')}}]); \ No newline at end of file diff --git a/assets/js/418073dd.09978ad3.js b/assets/js/418073dd.93b07b14.js similarity index 98% rename from assets/js/418073dd.09978ad3.js rename to assets/js/418073dd.93b07b14.js index 0bf65f8..d84438e 100644 --- a/assets/js/418073dd.09978ad3.js +++ b/assets/js/418073dd.93b07b14.js @@ -1 +1 @@ -"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[21],{3905:(e,r,n)=>{n.d(r,{Zo:()=>u,kt:()=>g});var t=n(7294);function o(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function i(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function f(e){for(var r=1;r=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=t.createContext({}),l=function(e){var r=t.useContext(c),n=r;return e&&(n="function"==typeof e?e(r):f(f({},r),e)),n},u=function(e){var r=l(e.components);return t.createElement(c.Provider,{value:r},e.children)},d="mdxType",s={inlineCode:"code",wrapper:function(e){var r=e.children;return t.createElement(t.Fragment,{},r)}},p=t.forwardRef((function(e,r){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,u=a(e,["components","mdxType","originalType","parentName"]),d=l(n),p=o,g=d["".concat(c,".").concat(p)]||d[p]||s[p]||i;return n?t.createElement(g,f(f({ref:r},u),{},{components:n})):t.createElement(g,f({ref:r},u))}));function g(e,r){var n=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var i=n.length,f=new Array(i);f[0]=p;var a={};for(var c in r)hasOwnProperty.call(r,c)&&(a[c]=r[c]);a.originalType=e,a[d]="string"==typeof e?e:o,f[1]=a;for(var l=2;l{n.r(r),n.d(r,{assets:()=>c,contentTitle:()=>f,default:()=>s,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var t=n(7462),o=(n(7294),n(3905));const i={},f="Ring Buffer",a={unversionedId:"generic/ring_buffer",id:"generic/ring_buffer",title:"Ring Buffer",description:"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.",source:"@site/../documentation/generic/ring_buffer.md",sourceDirName:"generic",slug:"/generic/ring_buffer",permalink:"/Extended.Collections/generic/ring_buffer",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/ring_buffer.md",tags:[],version:"current",lastUpdatedAt:1694569887,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{},sidebar:"defaultSidebar",previous:{title:"Ordered Dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary"}},c={},l=[],u={toc:l},d="wrapper";function s(e){let{components:r,...n}=e;return(0,o.kt)(d,(0,t.Z)({},u,n,{components:r,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"ring-buffer"},"Ring Buffer"),(0,o.kt)("p",null,"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-csharp",metastring:"file=../../src/Extended.Collections.Playground/Generic/RingBufferSandbox.cs#L2-",file:"../../src/Extended.Collections.Playground/Generic/RingBufferSandbox.cs#L2-"},'using Extended.Collections.Generic;\n\npublic class RingBufferSandbox : Sandbox\n{\n private readonly RingBuffer m_buffer = new (3);\n\n protected override void Run()\n {\n m_buffer.Add("A");\n m_buffer.Add("B");\n m_buffer.Add("C");\n Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]\n\n m_buffer.Add("D");\n Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]\n\n m_buffer.Remove("C");\n Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]\n\n m_buffer.Add("E");\n Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]\n\n m_buffer.Clear();\n Logger.Information("5. {Buffer}", m_buffer); // [ ]\n }\n}\n')))}s.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[21],{3905:(e,r,n)=>{n.d(r,{Zo:()=>u,kt:()=>g});var t=n(7294);function o(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function i(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function f(e){for(var r=1;r=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=t.createContext({}),l=function(e){var r=t.useContext(c),n=r;return e&&(n="function"==typeof e?e(r):f(f({},r),e)),n},u=function(e){var r=l(e.components);return t.createElement(c.Provider,{value:r},e.children)},d="mdxType",s={inlineCode:"code",wrapper:function(e){var r=e.children;return t.createElement(t.Fragment,{},r)}},p=t.forwardRef((function(e,r){var n=e.components,o=e.mdxType,i=e.originalType,c=e.parentName,u=a(e,["components","mdxType","originalType","parentName"]),d=l(n),p=o,g=d["".concat(c,".").concat(p)]||d[p]||s[p]||i;return n?t.createElement(g,f(f({ref:r},u),{},{components:n})):t.createElement(g,f({ref:r},u))}));function g(e,r){var n=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var i=n.length,f=new Array(i);f[0]=p;var a={};for(var c in r)hasOwnProperty.call(r,c)&&(a[c]=r[c]);a.originalType=e,a[d]="string"==typeof e?e:o,f[1]=a;for(var l=2;l{n.r(r),n.d(r,{assets:()=>c,contentTitle:()=>f,default:()=>s,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var t=n(7462),o=(n(7294),n(3905));const i={},f="Ring Buffer",a={unversionedId:"generic/ring_buffer",id:"generic/ring_buffer",title:"Ring Buffer",description:"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.",source:"@site/../documentation/generic/ring_buffer.md",sourceDirName:"generic",slug:"/generic/ring_buffer",permalink:"/Extended.Collections/generic/ring_buffer",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/generic/ring_buffer.md",tags:[],version:"current",lastUpdatedAt:1694570076,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{},sidebar:"defaultSidebar",previous:{title:"Ordered Dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary"}},c={},l=[],u={toc:l},d="wrapper";function s(e){let{components:r,...n}=e;return(0,o.kt)(d,(0,t.Z)({},u,n,{components:r,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"ring-buffer"},"Ring Buffer"),(0,o.kt)("p",null,"A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-csharp",metastring:"file=../../src/Extended.Collections.Playground/Generic/RingBufferSandbox.cs#L2-",file:"../../src/Extended.Collections.Playground/Generic/RingBufferSandbox.cs#L2-"},'using Extended.Collections.Generic;\n\npublic class RingBufferSandbox : Sandbox\n{\n private readonly RingBuffer m_buffer = new (3);\n\n protected override void Run()\n {\n m_buffer.Add("A");\n m_buffer.Add("B");\n m_buffer.Add("C");\n Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]\n\n m_buffer.Add("D");\n Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]\n\n m_buffer.Remove("C");\n Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]\n\n m_buffer.Add("E");\n Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]\n\n m_buffer.Clear();\n Logger.Information("5. {Buffer}", m_buffer); // [ ]\n }\n}\n')))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8cbb5538.1ef0cc3b.js b/assets/js/8cbb5538.c9c8bc91.js similarity index 98% rename from assets/js/8cbb5538.1ef0cc3b.js rename to assets/js/8cbb5538.c9c8bc91.js index 47882cb..4c50e8a 100644 --- a/assets/js/8cbb5538.1ef0cc3b.js +++ b/assets/js/8cbb5538.c9c8bc91.js @@ -1 +1 @@ -"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[192],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>y});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),d=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=d(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=d(n),f=a,y=p["".concat(c,".").concat(f)]||p[f]||u[f]||i;return n?r.createElement(y,o(o({ref:t},s),{},{components:n})):r.createElement(y,o({ref:t},s))}));function y(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[p]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var r=n(7462),a=(n(7294),n(3905));const i={sidebar_position:1},o="Introduction",l={unversionedId:"index",id:"index",title:"Introduction",description:"Collections Extended a zero dependency netstandard library that contains an array of different generic collections to use in any application. Each collection has it's own use",source:"@site/../documentation/index.md",sourceDirName:".",slug:"/",permalink:"/Extended.Collections/",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/index.md",tags:[],version:"current",lastUpdatedAt:1694569887,formattedLastUpdatedAt:"Sep 13, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"defaultSidebar",next:{title:"Ordered Dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary"}},c={},d=[{value:"Collections",id:"collections",level:2}],s={toc:d},p="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"introduction"},"Introduction"),(0,a.kt)("p",null,"Collections Extended a zero dependency ",(0,a.kt)("em",{parentName:"p"},"netstandard")," library that contains an array of different generic collections to use in any application. Each collection has it's own use\ncase and is fully covered in unit tests giving you confidence they they work. "),(0,a.kt)("p",null,"Have a collection type that you would want to add? Feel free to make a pull request."),(0,a.kt)("h2",{id:"collections"},"Collections"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Name"),(0,a.kt)("th",{parentName:"tr",align:null},"Type Name"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("a",{parentName:"td",href:"/Extended.Collections/generic/ring_buffer"},"Ring Buffer")),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"Collections.Extended.Generic.RingBuffer")),(0,a.kt)("td",{parentName:"tr",align:null},"A ring buffer efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("a",{parentName:"td",href:"/Extended.Collections/generic/specialized/ordered_dictionary"},"OrderedDictionary")),(0,a.kt)("td",{parentName:"tr",align:null},"'Extended.Collections.Generic.Specialized.OrderedDictionary"),(0,a.kt)("td",{parentName:"tr",align:null},"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.")))))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkextended_collections=self.webpackChunkextended_collections||[]).push([[192],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>y});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),d=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=d(e.components);return r.createElement(c.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=d(n),f=a,y=p["".concat(c,".").concat(f)]||p[f]||u[f]||i;return n?r.createElement(y,o(o({ref:t},s),{},{components:n})):r.createElement(y,o({ref:t},s))}));function y(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=f;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[p]="string"==typeof e?e:a,o[1]=l;for(var d=2;d{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var r=n(7462),a=(n(7294),n(3905));const i={sidebar_position:1},o="Introduction",l={unversionedId:"index",id:"index",title:"Introduction",description:"Collections Extended a zero dependency netstandard library that contains an array of different generic collections to use in any application. Each collection has it's own use",source:"@site/../documentation/index.md",sourceDirName:".",slug:"/",permalink:"/Extended.Collections/",draft:!1,editUrl:"https://github.com/ByronMayne/Extended.Collections/edit/main/documentation/index.md",tags:[],version:"current",lastUpdatedAt:1694570076,formattedLastUpdatedAt:"Sep 13, 2023",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"defaultSidebar",next:{title:"Ordered Dictionary",permalink:"/Extended.Collections/generic/specialized/ordered_dictionary"}},c={},d=[{value:"Collections",id:"collections",level:2}],s={toc:d},p="wrapper";function u(e){let{components:t,...n}=e;return(0,a.kt)(p,(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"introduction"},"Introduction"),(0,a.kt)("p",null,"Collections Extended a zero dependency ",(0,a.kt)("em",{parentName:"p"},"netstandard")," library that contains an array of different generic collections to use in any application. Each collection has it's own use\ncase and is fully covered in unit tests giving you confidence they they work. "),(0,a.kt)("p",null,"Have a collection type that you would want to add? Feel free to make a pull request."),(0,a.kt)("h2",{id:"collections"},"Collections"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Name"),(0,a.kt)("th",{parentName:"tr",align:null},"Type Name"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("a",{parentName:"td",href:"/Extended.Collections/generic/ring_buffer"},"Ring Buffer")),(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"Collections.Extended.Generic.RingBuffer")),(0,a.kt)("td",{parentName:"tr",align:null},"A ring buffer efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("a",{parentName:"td",href:"/Extended.Collections/generic/specialized/ordered_dictionary"},"OrderedDictionary")),(0,a.kt)("td",{parentName:"tr",align:null},"'Extended.Collections.Generic.Specialized.OrderedDictionary"),(0,a.kt)("td",{parentName:"tr",align:null},"Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.")))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.c98d41a6.js b/assets/js/runtime~main.c98d41a6.js deleted file mode 100644 index 6de43fd..0000000 --- a/assets/js/runtime~main.c98d41a6.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t,r,o,n,a={},i={};function d(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return a[e].call(r.exports,r,r.exports,d),r.exports}d.m=a,e=[],d.O=(t,r,o,n)=>{if(!r){var a=1/0;for(l=0;l=n)&&Object.keys(d.O).every((e=>d.O[e](r[f])))?r.splice(f--,1):(i=!1,n0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[r,o,n]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);d.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var i=2&o&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,d.d(n,a),n},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({21:"418073dd",53:"935f2afb",102:"6794d4cd",127:"ede3a018",192:"8cbb5538",285:"246f2c6f",333:"1f958b60",514:"1be78505",524:"e26cfe93",609:"15f4476d",616:"946bd85a",627:"23abe487",843:"68e633d4",918:"17896441",983:"ba8b3534"}[e]||e)+"."+{21:"09978ad3",53:"39d66f58",102:"88571500",127:"1a4ef5de",192:"1ef0cc3b",285:"02c64550",333:"258004ec",368:"cf67e7b1",514:"712442a1",524:"b9e519eb",609:"d5f9555a",616:"b86f1f03",627:"5c18fe8c",843:"781ef39d",918:"1ce773d5",972:"6f65d534",983:"4901bbe6"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},n="extended-collections:",d.l=(e,t,r,a)=>{if(o[e])o[e].push(t);else{var i,f;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l{i.onerror=i.onload=null,clearTimeout(b);var n=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(r))),t)return t(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=s.bind(null,i.onerror),i.onload=s.bind(null,i.onload),f&&document.head.appendChild(i)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/Extended.Collections/",d.gca=function(e){return e={17896441:"918","418073dd":"21","935f2afb":"53","6794d4cd":"102",ede3a018:"127","8cbb5538":"192","246f2c6f":"285","1f958b60":"333","1be78505":"514",e26cfe93:"524","15f4476d":"609","946bd85a":"616","23abe487":"627","68e633d4":"843",ba8b3534:"983"}[e]||e,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var o=d.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=d.p+d.u(t),i=new Error;d.l(a,(r=>{if(d.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",i.name="ChunkLoadError",i.type=n,i.request=a,o[1](i)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var o,n,a=r[0],i=r[1],f=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in i)d.o(i,o)&&(d.m[o]=i[o]);if(f)var l=f(d)}for(t&&t(r);c{"use strict";var e,t,r,o,n,a={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return a[e].call(r.exports,r,r.exports,i),r.exports}i.m=a,e=[],i.O=(t,r,o,n)=>{if(!r){var a=1/0;for(l=0;l=n)&&Object.keys(i.O).every((e=>i.O[e](r[c])))?r.splice(c--,1):(f=!1,n0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[r,o,n]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var f=2&o&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,i.d(n,a),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>"assets/js/"+({21:"418073dd",53:"935f2afb",102:"6794d4cd",127:"ede3a018",192:"8cbb5538",285:"246f2c6f",333:"1f958b60",514:"1be78505",524:"e26cfe93",609:"15f4476d",616:"946bd85a",627:"23abe487",843:"68e633d4",918:"17896441",983:"ba8b3534"}[e]||e)+"."+{21:"93b07b14",53:"39d66f58",102:"88571500",127:"1a4ef5de",192:"c9c8bc91",285:"e855fb24",333:"e5718319",368:"cf67e7b1",514:"712442a1",524:"b9e519eb",609:"d5f9555a",616:"b86f1f03",627:"5c18fe8c",843:"781ef39d",918:"1ce773d5",972:"6f65d534",983:"4901bbe6"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},n="extended-collections:",i.l=(e,t,r,a)=>{if(o[e])o[e].push(t);else{var f,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),l=0;l{f.onerror=f.onload=null,clearTimeout(b);var n=o[e];if(delete o[e],f.parentNode&&f.parentNode.removeChild(f),n&&n.forEach((e=>e(r))),t)return t(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),c&&document.head.appendChild(f)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="/Extended.Collections/",i.gca=function(e){return e={17896441:"918","418073dd":"21","935f2afb":"53","6794d4cd":"102",ede3a018:"127","8cbb5538":"192","246f2c6f":"285","1f958b60":"333","1be78505":"514",e26cfe93:"524","15f4476d":"609","946bd85a":"616","23abe487":"627","68e633d4":"843",ba8b3534:"983"}[e]||e,i.p+i.u(e)},(()=>{var e={303:0,532:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),f=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",f.name="ChunkLoadError",f.type=n,f.request=a,o[1](f)}}),"chunk-"+t,t)}},i.O.j=t=>0===e[t];var t=(t,r)=>{var o,n,a=r[0],f=r[1],c=r[2],d=0;if(a.some((t=>0!==e[t]))){for(o in f)i.o(f,o)&&(i.m[o]=f[o]);if(c)var l=c(i)}for(t&&t(r);d Ring Buffer | Extended.Collections - +
-

Ring Buffer

A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.

using Extended.Collections.Generic;

public class RingBufferSandbox : Sandbox
{
private readonly RingBuffer<string> m_buffer = new (3);

protected override void Run()
{
m_buffer.Add("A");
m_buffer.Add("B");
m_buffer.Add("C");
Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]

m_buffer.Add("D");
Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]

m_buffer.Remove("C");
Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]

m_buffer.Add("E");
Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]

m_buffer.Clear();
Logger.Information("5. {Buffer}", m_buffer); // [ ]
}
}
- +

Ring Buffer

A ring buffer is a data structure that efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.

using Extended.Collections.Generic;

public class RingBufferSandbox : Sandbox
{
private readonly RingBuffer<string> m_buffer = new (3);

protected override void Run()
{
m_buffer.Add("A");
m_buffer.Add("B");
m_buffer.Add("C");
Logger.Information("1. {Buffer}", m_buffer); // 1. [ "A", "B", "C" ]

m_buffer.Add("D");
Logger.Information("2. {Buffer}", m_buffer); // 2. [ "B", "C", "D" ]

m_buffer.Remove("C");
Logger.Information("3. {Buffer}", m_buffer); // 3. [ "B", "D" ]

m_buffer.Add("E");
Logger.Information("4. {Buffer}", m_buffer); // 4. [ "B", "D", "E" ]

m_buffer.Clear();
Logger.Information("5. {Buffer}", m_buffer); // [ ]
}
}
+ \ No newline at end of file diff --git a/generic/specialized/ordered_dictionary.html b/generic/specialized/ordered_dictionary.html index 22fbb62..c5db78d 100644 --- a/generic/specialized/ordered_dictionary.html +++ b/generic/specialized/ordered_dictionary.html @@ -4,13 +4,13 @@ Ordered Dictionary | Extended.Collections - +
-

Ordered Dictionary

Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.

Pros:

  • Maintains the order of key-value pairs, which can be useful for scenarios where the order of insertion or access is important.
  • Provides the functionality of a dictionary, allowing for fast key-based lookups.
  • Supports generic TKey and TValue types, making it flexible for various data types.

Cons:

  • Slightly higher memory usage compared to a regular dictionary due to the need to store the order of items.
  • Some operations may be slower compared to a regular dictionary due to maintaining the order.

Hypothetical Use Case:

Suppose you are building a task management application, and you need to maintain a list of tasks for a project while preserving the order in which they were added. An OrderedDictionary can be useful in this scenario to store and manage tasks associated with a project.

using System.Collections;

namespace Extended.Collections.Playground.Generic.Specialized;

public class OrderedDictionarySandbox : Sandbox
{
private OrderedDictionary<string, string> m_tasks = new ();

protected override void Run()
{
// Add tasks to the project in a specific order.
m_tasks.Add("Task1", "Complete research");
m_tasks.Add("Task2", "Write documentation");
m_tasks.Add("Task3", "Test functionality");

// Access tasks by their keys while maintaining their order.
Console.WriteLine("Project Tasks:");
foreach (KeyValuePair<string, string> entry in m_tasks)
{
Console.WriteLine($"TaskId: {entry.Key}");
Console.WriteLine($"Name:{entry.Value}");
}

// Remove
m_tasks.RemoveAt(1); // Remove by index
m_tasks.Remove("Task1"); // Remove by key

Logger.Information("Value: {Value}", m_tasks);
// 1. [ 'Task2' ] = "Write documentation"
// 2. [ 'Task3' ] = "Test functionality"
}
}
- +

Ordered Dictionary

Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.

Pros:

  • Maintains the order of key-value pairs, which can be useful for scenarios where the order of insertion or access is important.
  • Provides the functionality of a dictionary, allowing for fast key-based lookups.
  • Supports generic TKey and TValue types, making it flexible for various data types.

Cons:

  • Slightly higher memory usage compared to a regular dictionary due to the need to store the order of items.
  • Some operations may be slower compared to a regular dictionary due to maintaining the order.

Hypothetical Use Case:

Suppose you are building a task management application, and you need to maintain a list of tasks for a project while preserving the order in which they were added. An OrderedDictionary can be useful in this scenario to store and manage tasks associated with a project.

using System.Collections;

namespace Extended.Collections.Playground.Generic.Specialized;

public class OrderedDictionarySandbox : Sandbox
{
private OrderedDictionary<string, string> m_tasks = new ();

protected override void Run()
{
// Add tasks to the project in a specific order.
m_tasks.Add("Task1", "Complete research");
m_tasks.Add("Task2", "Write documentation");
m_tasks.Add("Task3", "Test functionality");

// Access tasks by their keys while maintaining their order.
Console.WriteLine("Project Tasks:");
foreach (KeyValuePair<string, string> entry in m_tasks)
{
Console.WriteLine($"TaskId: {entry.Key}");
Console.WriteLine($"Name:{entry.Value}");
}

// Remove
m_tasks.RemoveAt(1); // Remove by index
m_tasks.Remove("Task1"); // Remove by key

Logger.Information("Value: {Value}", m_tasks);
// 1. [ 'Task2' ] = "Write documentation"
// 2. [ 'Task3' ] = "Test functionality"
}
}
+ \ No newline at end of file diff --git a/index.html b/index.html index e574408..3d148bf 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,14 @@ Introduction | Extended.Collections - +

Introduction

Collections Extended a zero dependency netstandard library that contains an array of different generic collections to use in any application. Each collection has it's own use -case and is fully covered in unit tests giving you confidence they they work.

Have a collection type that you would want to add? Feel free to make a pull request.

Collections

NameType NameDescription
Ring BufferCollections.Extended.Generic.RingBuffer<T>A ring buffer efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.
OrderedDictionary'Extended.Collections.Generic.Specialized.OrderedDictionary<TKey, TValue>Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.
- +case and is fully covered in unit tests giving you confidence they they work.

Have a collection type that you would want to add? Feel free to make a pull request.

Collections

NameType NameDescription
Ring BufferCollections.Extended.Generic.RingBuffer<T>A ring buffer efficiently manages a fixed-size, cyclically-referenced buffer, allowing for constant-time insertions and removals while overwriting the oldest data when full.
OrderedDictionary'Extended.Collections.Generic.Specialized.OrderedDictionary<TKey, TValue>Combines the features of a dictionary and a list, allowing key-value pairs to be stored in a specific order and accessed efficiently by their keys.
+ \ No newline at end of file