This is a package of static functions which perform computations on arrays. Generally these routines attempt to complete without throwing errors by ignoring data they cannot understand.


The following tables list the members exposed by ArrayFuncs.

Public Constructors

  Name Description
Public method ArrayFuncs Initializes a new instance of the ArrayFuncs class.
Top

Public Methods

  Name Description
Public method Static ArrayDescription Generate a description of an array (presumed rectangular).
Public method Static ArrayEquals Overloaded. Are two objects equal? Arrays have the standard object equals method which only returns true if the two object are the same. This method returns true if every element of the arrays match. The inputs may be of any dimensionality. The dimensionality and dimensions of the arrays must match as well as any elements. If the elements are non-primitive. non-array objects, then the equals method is called for each element. If both elements are multi-dimensional arrays, then the method recurses.
Public method Static ComputeSize Compute the size of an object. Note that this only handles arrays or scalars of the primitive objects and Strings. It returns 0 for any object array element it does not understand.
Public method Static ConvertArray Convert an array to a specified type. This method supports conversions only among the primitive numeric types.
Public method Static CopyArray Copy one array into another. This function copies the contents of one array into a previously allocated array. The arrays must agree in type and size.
Public method Static CountDimensions Method to count the dimensions of array
Public method Static CountElements Count the number of elements in an array
Public method Static Curl Curl an input array up into a multi-dimensional array.
Public method Static DeepClone Try to create a deep clone of an Array or a standard clone of a scalar. The object may comprise arrays of any primitive type or any Object type which implements Cloneable. However, if the Object is some kind of collection, e.g., a Vector then only a shallow copy of that object is made. I.e., deep refers only to arrays.
Public method Equals Determines whether the specified Object is equal to the current Object. (inherited from Object)
Public method Static Flatten Given an array of arbitrary dimensionality return the array flattened into a single dimension.
Public method Static GenericClone Clone an Object if possible. * This method returns an Object which is a clone of the input object. It checks if the method implements the Cloneable interface and then uses reflection to invoke the clone method. This can't be done directly since as far as the compiler is concerned the clone method for Object is protected and someone could implement Cloneable but leave the clone method protected. The cloning can fail in a variety of ways which are trapped so that it returns null instead. This method will generally create a shallow clone. If you wish a deep copy of an array the method DeepClone should be used. *
Public method Static GetBaseClass This routine returns the base class of an object. This is just the class of the object for non-arrays.
Public method Static GetBaseLength This routine returns the size of the base element of an array.
Public method Static GetBaseType This routine returns the base class of an object with the dimension indication in form of brackets and/or commas. This is just the type of the object for non-arrays.
Public method Static GetDimensions Find the dimensions of an object. * This method returns an integer array with the dimensions of the object o which should usually be an array. * It returns an array of dimension 0 for scalar objects and it returns -1 for dimension which have not been allocated, e.g., int[][][] x = new int[100][][]; should return [100,-1,-1]. *
Public method GetHashCode Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table. (inherited from Object)
Public method GetType Gets the Type of the current instance. (inherited from Object)
Public method Static IsArrayOfArrays Checks whether the object is a type of Array of Arrays
Public method Static MimicArray Create an array of a type given by new type with the dimensionality given in array.
Public method Static NewInstance Overloaded. Allocate an array dynamically. The Array.NewInstance method does not throw an error.
Public method Static NextIndex Overloaded. Check whether next index
Public method ToString Returns a String that represents the current Object. (inherited from Object)
Top

Protected Methods

  Name Description
Family method Static DoFlatten This routine does the actually flattening of multi-dimensional arrays.
Family method Finalize Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (inherited from Object)
Family method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object)
Top

See Also