Table of Contents

Interface INodeManager<T>

Defines the contract for a collection manager that stores and queries NodeController<T> instances.

public interface INodeManager<T>

Type Parameters

T

The data type wrapped by each node.

Methods

AddNode(NodeController<T>)

Adds a node to the collection. Returns true on success.

bool AddNode(NodeController<T> node)

Parameters

node NodeController<T>

Returns

bool

Clear()

Removes all nodes and disposes each one.

void Clear()

FromJson(string)

Deserialises and replaces the collection from a JSON string.

void FromJson(string json)

Parameters

json string

GetAllNodes()

Returns an enumerable of all nodes currently in the collection.

IEnumerable<NodeController<T>> GetAllNodes()

Returns

IEnumerable<NodeController<T>>

GetAllNodesList()

Returns a new List<T> copy of all nodes.

List<NodeController<T>> GetAllNodesList()

Returns

List<NodeController<T>>

GetNode(Func<T, bool>)

Returns the first node value that satisfies predicate, or default.

T GetNode(Func<T, bool> predicate)

Parameters

predicate Func<T, bool>

Returns

T

RemoveNode(NodeController<T>)

Removes a node from the collection. Returns true on success.

bool RemoveNode(NodeController<T> node)

Parameters

node NodeController<T>

Returns

bool

RemoveWhere(Func<T, bool>)

Removes all nodes whose data satisfies predicate.

void RemoveWhere(Func<T, bool> predicate)

Parameters

predicate Func<T, bool>

ToJson()

Serialises the collection to a JSON string.

string ToJson()

Returns

string