Able
Askowl Base Library Enabler
Askowl.LinkedList< T > Class Template Reference

LinkedList - a different perspective More...

Inheritance diagram for Askowl.LinkedList< T >:

Classes

class  Node
 LinkedList node More...
 

Public Member Functions

 LinkedList (string name=null)
 Get an instance of this type of linked list More...
 
void Destroy ()
 For the rare times we need to clear a linked list More...
 
void Dispose ()
 For the rare times we need to clear a linked list More...
 
Node Add (T item)
 Add an Item to a List More...
 
Node GetRecycledOrNew ()
 Retrieve a node - either from recycling or creating it anew More...
 
Node ReverseLookup (T item)
 For node disposal using reverse lookup More...
 
void Dispose (T item)
 Node Dispose using reverse lookup More...
 
Node Push (T item)
 Add an item to the list More...
 
Node Push (Node node)
 Add a node to the list More...
 
Pop ()
 Retrieve the first list item - Node.Recycle More...
 
Pull ()
 Pull the last item from the list More...
 
string Dump (int maxEntriesToDump=1000)
 Return list contents as a string More...
 
override string ToString ()
 

Public Attributes

string Name
 Linked List Name More...
 
LinkedList< T > RecycleBin => isRecycleBin ? null : recycleBin ?? (recycleBin = NewRecycleBin)
 List for Unused Nodes More...
 
Node First
 First Node in List or null More...
 
Node Last
 Last Node in List or null More...
 
Node Second => First?.Next
 Second item in the list or null More...
 
bool Empty => First == null
 Is list empty? More...
 

Static Public Attributes

static Func< T > CreateItemStatic = GetDefaultCreateItem()
 Item Creation and Preparation when new() is not enough More...
 
static Action< NodeReactivateItemStatic = GetDefaultReactivateItem()
 Actor we can create if reactivation requires additional code More...
 
static Action< NodeDeactivateItemStatic = GetDefaultDeactivateItem()
 Called before an item is returned to recycling More...
 
static bool DebugMode = false
 Debug mode logs changes More...
 

Properties

Func< T > CreateItem = () => CreateItemStatic() [set]
 Item Creation and Preparation when new() is not enough More...
 
Action< NodeReactivateItem = (node) => ReactivateItemStatic(node) [set]
 Prepare an idle item for reuse More...
 
Action< NodeDeactivateItem = (node) => DeactivateItemStatic(node) [set]
 For Deactivation when Dispose() is not enough More...
 
static Func< Node, Node, int > CompareItemStatic [set]
 Used to insert items into the correct location for sorted lists More...
 
Func< Node, Node, int > CompareItem [set]
 Used to insert items into the correct location for sorted lists More...
 
int Count [get]
 Calculate number of items in a list More...
 

Detailed Description

Constructor & Destructor Documentation

◆ LinkedList()

Member Function Documentation

◆ Add()

Node Askowl.LinkedList< T >.Add ( item)

Add an Item to a List

Definition at line 196 of file LinkedList.cs.

◆ Destroy()

void Askowl.LinkedList< T >.Destroy ( )

◆ Dispose() [1/2]

void Askowl.LinkedList< T >.Dispose ( )

◆ Dispose() [2/2]

◆ Dump()

string Askowl.LinkedList< T >.Dump ( int  maxEntriesToDump = 1000)

Return list contents as a string

Definition at line 352 of file LinkedList.cs.

◆ GetRecycledOrNew()

◆ Pop()

◆ Pull()

T Askowl.LinkedList< T >.Pull ( )

Pull the last item from the list

Definition at line 332 of file LinkedList.cs.

◆ Push() [1/2]

◆ Push() [2/2]

◆ ReverseLookup()

Node Askowl.LinkedList< T >.ReverseLookup ( item)

◆ ToString()

override string Askowl.LinkedList< T >.ToString ( )

Definition at line 364 of file LinkedList.cs.

Member Data Documentation

◆ CreateItemStatic

Func<T> Askowl.LinkedList< T >.CreateItemStatic = GetDefaultCreateItem()
static

◆ DeactivateItemStatic

Action<Node> Askowl.LinkedList< T >.DeactivateItemStatic = GetDefaultDeactivateItem()
static

◆ DebugMode

bool Askowl.LinkedList< T >.DebugMode = false
static

Debug mode logs changes

Definition at line 343 of file LinkedList.cs.

◆ Empty

bool Askowl.LinkedList< T >.Empty => First == null

Is list empty?

Definition at line 312 of file LinkedList.cs.

◆ First

Node Askowl.LinkedList< T >.First

First Node in List or null

Definition at line 303 of file LinkedList.cs.

◆ Last

Last Node in List or null

Definition at line 306 of file LinkedList.cs.

◆ Name

string Askowl.LinkedList< T >.Name

Linked List Name

Definition at line 136 of file LinkedList.cs.

◆ ReactivateItemStatic

Action<Node> Askowl.LinkedList< T >.ReactivateItemStatic = GetDefaultReactivateItem()
static

◆ RecycleBin

LinkedList<T> Askowl.LinkedList< T >.RecycleBin => isRecycleBin ? null : recycleBin ?? (recycleBin = NewRecycleBin)

List for Unused Nodes

Definition at line 293 of file LinkedList.cs.

◆ Second

Node Askowl.LinkedList< T >.Second => First?.Next

Second item in the list or null

Definition at line 309 of file LinkedList.cs.

Property Documentation

◆ CompareItem

◆ CompareItemStatic

Func<Node, Node, int> Askowl.LinkedList< T >.CompareItemStatic
staticset

◆ Count

int Askowl.LinkedList< T >.Count
get

◆ CreateItem

Func<T> Askowl.LinkedList< T >.CreateItem = () => CreateItemStatic()
set

◆ DeactivateItem

Action<Node> Askowl.LinkedList< T >.DeactivateItem = (node) => DeactivateItemStatic(node)
set

◆ ReactivateItem

Action<Node> Askowl.LinkedList< T >.ReactivateItem = (node) => ReactivateItemStatic(node)
set

Prepare an idle item for reuse

Definition at line 148 of file LinkedList.cs.


The documentation for this class was generated from the following file: