Class ListManipulator<TList, TElement>
Provides the ability to manipulate lists (classes that implement IList<T>).
Implements
ISequenceManipulator<TList, TElement>
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions.Automata
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public sealed class ListManipulator<TList, TElement> : ISequenceManipulator<TList, TElement> where TList : class, IList<TElement>, new()
Type Parameters
Name | Description |
---|---|
TList | The type of a list. |
TElement | The type of a list element. |
Properties
SequenceEqualityComparer
Declaration
public IEqualityComparer<TList> SequenceEqualityComparer { get; }
Property Value
Type | Description |
---|---|
IEqualityComparer<TList> |
Methods
Concat(TList, TList)
Creates a list by copying the first list and then appending the second list to it.
Declaration
public TList Concat(TList sequence1, TList sequence2)
Parameters
Type | Name | Description |
---|---|---|
TList | sequence1 | The first list. |
TList | sequence2 | The second list. |
Returns
Type | Description |
---|---|
TList | The created list. |
GetElement(TList, Int32)
Gets the element at a given position in a given list.
Declaration
public TElement GetElement(TList sequence, int index)
Parameters
Type | Name | Description |
---|---|---|
TList | sequence | The list. |
Int32 | index | The position. |
Returns
Type | Description |
---|---|
TElement | The element at the given position in the list. |
GetLength(TList)
Gets the length of a given list.
Declaration
public int GetLength(TList sequence)
Parameters
Type | Name | Description |
---|---|---|
TList | sequence | The list. |
Returns
Type | Description |
---|---|
Int32 | The length of the list. |
ToSequence(IEnumerable<TElement>)
Converts a given collection of elements to a list.
Declaration
public TList ToSequence(IEnumerable<TElement> elements)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TElement> | elements | The collection of elements to convert to a sequence. |
Returns
Type | Description |
---|---|
TList | The list containing the elements. |