Show / Hide Table of Contents

Class ListLinked<T>

Implements a growing, singularly-linked list data structure that inherits InterfaceTraversable.

Inheritance
System.Object
ListLinked<T>
Implements
IList<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<T>
DataStructure.IAddable<T>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<ListLinked<T>>
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class ListLinked<T> : object, IList<T>, IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, DataStructure.IAddable<T>, DataStructure.ICountable, DataStructure.IClearable, ICloneable<ListLinked<T>>
Type Parameters
Name Description
T

The type of objects to be placed in the list.

Constructors

| Improve this Doc View Source

ListLinked()

Creates an instance of a ListLinked<T>.

Declaration
public ListLinked()

Properties

| Improve this Doc View Source

Count

Gets the current count of the data structure.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Clear()

Returns the data structure to an empty state.

Declaration
public void Clear()
| Improve this Doc View Source

Clone()

Clones a T.

Declaration
public ListLinked<T> Clone()
Returns
Type Description
ListLinked<T>

A clone of the T.

| Improve this Doc View Source

GetEnumerator()

Declaration
public System.Collections.Generic.IEnumerator<T> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T>
| Improve this Doc View Source

RemoveAll<TPredicate>(TPredicate)

Removes all predicated items from the list.

Declaration
public void RemoveAll<TPredicate>(TPredicate predicate = default(TPredicate))
    where TPredicate : struct, IFunc<T, bool>
Parameters
Type Name Description
TPredicate predicate

The predicate to determine removal.

Type Parameters
Name Description
TPredicate

The type of predicate to determine removal.

| Improve this Doc View Source

RemoveFirst(Func<T, Boolean>)

Removes the first equality by object reference.

Declaration
public void RemoveFirst(Func<T, bool> predicate)
Parameters
Type Name Description
Func<T, System.Boolean> predicate

The predicate to determine removal.

| Improve this Doc View Source

StepperBreak<TStep>(TStep)

Traverses values and invokes a function on every T value.

Declaration
public StepStatus StepperBreak<TStep>(TStep step = default(TStep))
    where TStep : struct, IFunc<T, StepStatus>
Parameters
Type Name Description
TStep step

The function to invoke on every T value.

Returns
Type Description
StepStatus

The status of the traversal.

Type Parameters
Name Description
TStep

The type of function to invoke on every T value.

| Improve this Doc View Source

ToArray()

Constructs an array with the values of this data structure.

Declaration
public T[] ToArray()
Returns
Type Description
T[]

An array with the values of this data structure.

| Improve this Doc View Source

TryAdd(T)

Tries to add a value to a data structure.

Declaration
public (bool Success, Exception? Exception) TryAdd(T value)
Parameters
Type Name Description
T value

The value to add to the data structure.

Returns
Type Description
System.ValueTuple<System.Boolean, System.Nullable<Exception>>

True if the value was added or false if not.

| Improve this Doc View Source

TryRemoveFirst(Func<T, Boolean>)

Tries to remove the first predicated value if the value exists.

Declaration
public bool TryRemoveFirst(Func<T, bool> predicate)
Parameters
Type Name Description
Func<T, System.Boolean> predicate

The predicate to determine removal.

Returns
Type Description
System.Boolean

True if the value was removed. False if the value did not exist.

| Improve this Doc View Source

TryRemoveFirst(Func<T, Boolean>, out Nullable<Exception>)

Tries to remove the first predicated value if the value exists.

Declaration
public bool TryRemoveFirst(Func<T, bool> predicate, out Exception? exception)
Parameters
Type Name Description
Func<T, System.Boolean> predicate

The predicate to determine removal.

System.Nullable<Exception> exception

The exception that occurred if the remove failed.

Returns
Type Description
System.Boolean

True if the value was removed. False if the value did not exist.

| Improve this Doc View Source

TryRemoveFirst<TPredicate>(out Nullable<Exception>, TPredicate)

Tries to remove the first predicated value if the value exists.

Declaration
public bool TryRemoveFirst<TPredicate>(out Exception? exception, TPredicate predicate = default(TPredicate))
    where TPredicate : struct, IFunc<T, bool>
Parameters
Type Name Description
System.Nullable<Exception> exception

The exception that occurred if the remove failed.

TPredicate predicate

The predicate to determine removal.

Returns
Type Description
System.Boolean

True if the value was removed. False if the value did not exist.

Type Parameters
Name Description
TPredicate

The type of predicate to determine removal.

Implements

IList<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<>
DataStructure.IAddable<T>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX