MultiList<T>

public class MultiList<T>
Provides access to a sequential collection of lists.
TType to store in lists.

Constructors

MultiList

#
public MultiList()
Create a new blank multi-list.

MultiList

#
public MultiList(int initialCapacity)
Create a new blank multi-list.
initialCapacity (int)Initial capacity for first list.

Properties

CurrentCount

#
public int CurrentCount { get; }
Gets the total number of items in the current list.

EmptyLists

#
public int EmptyLists { get; }
Gets the total number of empty lists in this multi-list.

ItemCount

#
public int ItemCount { get; }
Gets the total number of items.

Items

#
public IEnumerable<T> Items { get; }
Enumerate over all items.

ListCount

#
public int ListCount { get; }
Gets the number of sublists.

Lists

#
public IEnumerable<List<T>> Lists { get; }
Enumerate over all lists.

Indexers

this[]

#
public List<T> this[int index] { get; }
Gets the list at the given index.
index (int)List index.
List at index.

Methods

Add

#
public void Add(T item)
Add a new item to the current list.
item (T)Item to add.

AddRange

#
public void AddRange(IEnumerable<T> items)
Add a collection of items to the current list.
items (IEnumerable<T>)Items to add.

BeginNewList

#
public void BeginNewList()
Close the current list and begin a fresh list. If the current list is empty, nothing will happen.

Flatten

#
public void Flatten()
Collect all items in all lists and put them into a single list.

Posterize

#
public void Posterize(int size)
Chop all lists into smaller lists with the maximum count.
size (int)Maximum allowed list length.

SplitBetween

#
public void SplitBetween(Func<T, T, bool> splittingDelegate)
Split lists between specific items.
splittingDelegate (Func<T, T, bool>)Delegate for determining splitting locations.