SalArray

PPJ.Runtime.SalArray

Namespace: PPJ.Runtime

Assembly: PPJ.Runtime.49 (4.9.0.0)

Dynamic array class. This class replicates SAL dynamic arrays. It must be declared as an inner class of the class that should be used as the type of the elements of the dynamic array.

public class SalArray : IList, ICollection, IEnumerable, IXmlSerializable, ISalType

Properties

Count

Int32: Number of array elements

Dimensions

SalNumber: Returns the number of dimensions.

IsDynamic

Boolean: Returns true if the array is dynamic.

IsEmpty

Boolean: Returns true if the array is empty.

IsMultidimensional

Boolean: Returns true if the array is an MD array.

IsSynchronized

Boolean: IsSynchronized

Item(indices)

Object: Get/Set functions used to access the array. The implementation classes will call these methods from their indexers.

Length

SalNumber: Returns the total number of items in the array. For MD arrays returns the number of items in the first dimension.

SyncRoot

Object: SynchRoot

Methods

Add(value)

Appends one item to the array.

Parameter
Type
Description

value

Returns: Int32.

AddRange(collection)

Appends the collection of items to the array.

Parameter
Type
Description

collection

Avg()

Returns the average value of all the numbers in an array.

Returns: SalNumber. nAvg

Clear()

Clears a dynamic array

CopyTo(array, index)

CopyTo

Parameter
Type
Description

array

index

DimCount()

Returns the number of dimensions in an array.

Returns: SalNumber.

DimCount(nDim)

Parameter
Type
Description

Returns: Boolean.

Fill(value, count)

Fills an array with the specified value.

Parameter
Type
Description

value

count

Returns: Boolean.

Find(value, start)

Finds the value in the array. This is allowed only for single-dimension arrays.

Parameter
Type
Description

value

start

Returns: Int32.

FromNativeArray(array)

Creates a SalArray from a native array. The type is inferred from the array.

Parameter
Type
Description

array

Native array to convert to a SalArray.

Returns: SalArray.

FromNativeArray(array, dbType)

Creates a SalArray from a native array of the specified dbType .

Parameter
Type
Description

array

Native array to convert to a SalArray.

dbType

Type of the elements in the source array .

Returns: SalArray.

GetArray(capacity)

Returns the wrapped native array and ensures that the requested element is created for dynamic arrays.

Parameter
Type
Description

capacity

Returns: Array.

GetElementType()

Returns the type of the array elements

Returns: Type.

GetEnumerator()

IEnumerator implementation to support the foreach statement.

Returns: IEnumerator.

GetLength(dim)

Returns the number of items in the array

Parameter
Type
Description

dim

dimension, first = 1

Returns: Int32.

GetLowerBound(dim)

Returns the lower bound of the array.

Parameter
Type
Description

Returns: SalNumber.

GetLowerBound(dim, lbound)

Parameter
Type
Description

Returns: Boolean.

GetUpperBound(dim)

Returns the upper bound of an array.

Parameter
Type
Description

Returns: SalNumber.

GetUpperBound(dim, ubound)

Parameter
Type
Description

Returns: Boolean.

Insert(index)

Inserts an item at the position. This is allowed only for single-dimension arrays.

Parameter
Type
Description

index

MakeDynamic()

Makes the array dynamic.

Max()

Returns the maximum value in an array of numbers.

Returns: SalNumber.

Min()

Returns the minimum value in an array of numbers.

Returns: SalNumber.

QueryBounds(min, max)

Parameter
Type
Description

Returns: SalNumber.

Remove(index)

Removes the item at the index. This is allowed only for single-dimension arrays.

Parameter
Type
Description

index

Reset()

Resets a dynamic array

SetBounds(lower, upper)

Sets the lower and upper bound of an array for the first dimension only. NOTE: In SAL this function was named SalSetArrayBounds().

Parameter
Type
Description

lower

upper

Returns: Boolean.

SetLength(dim, length)

Changes the number of items in the array

Parameter
Type
Description

dim

dimension, first = 1

length

SetLowerBound(dim, bound)

Changes the lower bound of the array

Parameter
Type
Description

bound

Returns: Boolean.

SetUpperBound(dim, bound)

Sets the upper bound of an array. The first dimension is 1.

Parameter
Type
Description

bound

Returns: Boolean.

Sort(index, count, comparer)

Sorts the items in the array.

Parameter
Type
Description

index

count

comparer

Sort(comparer)

Sorts the items in the array.

Parameter
Type
Description

comparer

Sum()

Returns the sum of the elements in an array of numbers.

Returns: SalNumber.

ToNativeArray()

Converts to an array of native types.

Returns: Object.

Inherited By

Name
Description

Dynamic array generic class. This class replicates SAL dynamic arrays. It can be used without being declared as an inner class by using the new generics syntax.

Implements

Name
Description

Common base interface for Sal types.

Last updated