ArrayUtil
Description
Helper class for dealing with arrays.
This class provides some helper methods, dealing with the following:
-
Create arrays from specified values, see
From*
. -
Clear ranges of arrays to the default value, see
Clear*
. -
Copy ranges between arrays, see
Copy*
. -
Equality checks for arrays, see
Equals*
. -
Dynamically growing arrays, see
Grow*
. -
Wrapping of array data without copying, see
Wrap
.
Public / Constructors
Public / Methods
Clear
9 overloads
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Copy
9 overloads
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Equals
8 overloads
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
Compares the given array for equality.
EqualsDefault
Checks if the given arrays are equal.
The given array references are equal if one of the following conditions is true:
-
They refer to the same array instance.
-
They are both
null
. -
The two arrays contain the same sequence of elements, where element equality is defined by SystemUtil.EqualsDefault.
EqualsObject
Checks if the given arrays are equal.
The given array references are equal if one of the following conditions is true:
-
They refer to the same array instance.
-
They are both
null
. -
The two arrays contain the same sequence of elements, where element equality is determined via IEquatable.
EqualsValue
Checks if the given arrays are equal.
The given array references are equal if one of the following conditions is true:
-
They refer to the same array instance.
-
They are both
null
. -
The two arrays contain the same sequence of elements, where element equality is determined via IEquatable.
GrowCapacity
Grows the given capacity, making sure it stays within [0..2147483647] and is larger than or equal to required opt.
GrowUntil
Proportionally grows the given array until its length is equal to or greater than the specified length.
The new array length is computed as follows:
newLength := max(length, currentLength * 5 / 4)
where newLength
is the length of the returned array, length
is the value of the length in parameter and currentLength
is the length of the given array in.
If count in is greater than zero, all array elements in the range [0..count-1]
are copied from the given array in to the newly allocated one.
Wrap
2 overloads
Returns a IVectorConst object that wraps the given array.
The list will use the given array, no elements will be copied.
Returns a IVectorConst object that wraps the given array.
The list will use the given array, no elements will be copied.