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.
- C#
- VB.NET
public class SalArray : IList, ICollection, IEnumerable, IXmlSerializable, ISalType
Public Class SalArray
Inherits IList
Implements 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 | Object |
Returns: Int32.
AddRange(collection)
Appends the collection of items to the array.
| Parameter | Type | Description |
|---|---|---|
| collection | IEnumerable |
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 | Array | |
| index | Int32 |
DimCount()
Returns the number of dimensions in an array.
Returns: SalNumber.
DimCount(nDim)
| Parameter | Type | Description |
|---|---|---|
| nDim | SalNumber& |
Returns: Boolean.
Fill(value, count)
Fills an array with the specified value.
| Parameter | Type | Description |
|---|---|---|
| value | Object | |
| count | Int32 |
Returns: Boolean.
Find(value, start)
Finds the value in the array. This is allowed only for single-dimension arrays.
| Parameter | Type | Description |
|---|---|---|
| value | Object | |
| start | Int32 |
Returns: Int32.
FromNativeArray(array)
Creates a SalArray from a native array. The type is inferred from the array.
| Parameter | Type | Description |
|---|---|---|
| array | 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 | Array | Native array to convert to a SalArray. |
| dbType | 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 | Int32[] |
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 | Int32 | dimension, first = 1 |
Returns: Int32.
GetLowerBound(dim)
Returns the lower bound of the array.
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 |
Returns: SalNumber.
GetLowerBound(dim, lbound)
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 | |
| lbound | SalNumber& |
Returns: Boolean.
GetUpperBound(dim)
Returns the upper bound of an array.
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 |
Returns: SalNumber.
GetUpperBound(dim, ubound)
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 | |
| ubound | SalNumber& |
Returns: Boolean.
Insert(index)
Inserts an item at the position. This is allowed only for single-dimension arrays.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 |
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 |
|---|---|---|
| min | SalNumber& | |
| max | SalNumber& |
Returns: SalNumber.
Remove(index)
Removes the item at the index. This is allowed only for single-dimension arrays.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 |
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 | Int32 | |
| upper | Int32 |
Returns: Boolean.
SetLength(dim, length)
Changes the number of items in the array
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 | dimension, first = 1 |
| length | Int32 |
SetLowerBound(dim, bound)
Changes the lower bound of the array
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 | |
| bound | Int32 |
Returns: Boolean.
SetUpperBound(dim, bound)
Sets the upper bound of an array. The first dimension is 1.
| Parameter | Type | Description |
|---|---|---|
| dim | Int32 | |
| bound | Int32 |
Returns: Boolean.
Sort(index, count, comparer)
Sorts the items in the array.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | |
| count | Int32 | |
| comparer | IComparer |
Sort(comparer)
Sorts the items in the array.
| Parameter | Type | Description |
|---|---|---|
| comparer | IComparer |
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 |
|---|---|
| SalArray<T> | 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 |
|---|---|
| ISalType | Common base interface for Sal types. |