Table of Contents

Class SimDataVector

Namespace
LlamaLogic.Packages.Models.SimData
Assembly
LlamaLogic.Packages.dll

Represents a VECTOR value: a sequence of elements of one SimDataType (🔓)

public sealed class SimDataVector : Collection<object?>, IList<object?>, ICollection<object?>, IReadOnlyList<object?>, IReadOnlyCollection<object?>, IEnumerable<object?>, IList, ICollection, IEnumerable
Inheritance
SimDataVector
Implements
Inherited Members

Remarks

Elements are of the .NET type SimDataObject describes for ElementType, except that elements of a vector of OBJECT cannot be null and must all have the same SimDataSchema.

Constructors

SimDataVector(SimDataType, IEnumerable<object?>?)

Initializes a new SimDataVector with the specified elementType and optional initial elements

public SimDataVector(SimDataType elementType, IEnumerable<object?>? elements = null)

Parameters

elementType SimDataType
elements IEnumerable<object>

Exceptions

ArgumentOutOfRangeException

elementType is not a defined SimDataType

ArgumentException

An element is not valid for elementType

Properties

ElementType

Gets the type of the vector's elements

public SimDataType ElementType { get; }

Property Value

SimDataType

Methods

InsertItem(int, object?)

Inserts an element into the Collection<T> at the specified index.

protected override void InsertItem(int index, object? item)

Parameters

index int

The zero-based index at which item should be inserted.

item object

The object to insert. The value can be null for reference types.

Exceptions

ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than Count.

SetItem(int, object?)

Replaces the element at the specified index.

protected override void SetItem(int index, object? item)

Parameters

index int

The zero-based index of the element to replace.

item object

The new value for the element at the specified index. The value can be null for reference types.

Exceptions

ArgumentOutOfRangeException

index is less than zero.

-or-

index is greater than Count.