Class SimDataVector
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
elementTypeSimDataTypeelementsIEnumerable<object>
Exceptions
- ArgumentOutOfRangeException
elementTypeis 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
Methods
InsertItem(int, object?)
Inserts an element into the Collection<T> at the specified index.
protected override void InsertItem(int index, object? item)
Parameters
indexintThe zero-based index at which
itemshould be inserted.itemobjectThe object to insert. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
indexis less than zero.-or-
indexis greater than Count.
SetItem(int, object?)
Replaces the element at the specified index.
protected override void SetItem(int index, object? item)
Parameters
indexintThe zero-based index of the element to replace.
itemobjectThe new value for the element at the specified index. The value can be null for reference types.
Exceptions
- ArgumentOutOfRangeException
indexis less than zero.-or-
indexis greater than Count.