| 1 |
<Type Name="Array" FullName="System.Array"> |
| 2 |
<TypeSignature Language="C#" Value="public class Array" /> |
| 3 |
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Array extends System.Object" /> |
| 4 |
<AssemblyInfo> |
| 5 |
<AssemblyName>DocTest</AssemblyName> |
| 6 |
<AssemblyVersion>0.0.0.0</AssemblyVersion> |
| 7 |
</AssemblyInfo> |
| 8 |
<Base> |
| 9 |
<BaseTypeName>System.Object</BaseTypeName> |
| 10 |
</Base> |
| 11 |
<Interfaces /> |
| 12 |
<Docs> |
| 13 |
<summary> |
| 14 |
<para> Serves as the base class for arrays. Provides methods for creating, |
| 15 |
copying, manipulating, searching, and sorting arrays.</para> |
| 16 |
</summary> |
| 17 |
<remarks> |
| 18 |
<para>This class is intended to be used as a base class by |
| 19 |
language implementations that support arrays. Only the system can derive from |
| 20 |
this type: derived classes of <see cref="T:System.Array" /> are not to be created by the developer.</para> |
| 21 |
<block subset="none" type="note"> |
| 22 |
<para>An array is a collection of |
| 23 |
identically typed data <paramref name="elements" /> that are accessed and referenced by |
| 24 |
sets of integral <paramref name="indices" />. </para> |
| 25 |
<para>The <paramref name="rank" /> of an array is the number |
| 26 |
of dimensions in the array. Each dimension has its own set of indices. An array |
| 27 |
with a rank greater than one can have a different lower |
| 28 |
bound and a different number of elements for each dimension. Multidimensional |
| 29 |
arrays (i.e. arrays with a rank greater than one) are processed in row-major |
| 30 |
order. </para> |
| 31 |
<para>The <paramref name="lower bound" /> of a dimension |
| 32 |
is the starting index of that dimension. </para> |
| 33 |
<para>The <paramref name="length" /> of an array is the total number of elements contained in all of its |
| 34 |
dimensions. </para> |
| 35 |
<para>A <paramref name="vector" /> is a |
| 36 |
one-dimensional array with a <paramref name="lower bound" /> of '0'. </para> |
| 37 |
<para>If the implementer creates a derived class of <see cref="T:System.Array" />, expected <see cref="T:System.Array" /> behavior |
| 38 |
cannot be guaranteed. For information on array-like objects with increased |
| 39 |
functionality, see the <see cref="T:System.Collections.IList" /> and <see cref="T:System.Collections.Generic.IList<T>" /> interfaces. For more information regarding the use of arrays versus the use |
| 40 |
of collections, see Partition V of the CLI Specification. </para> |
| 41 |
</block> |
| 42 |
<para>Every specific <see cref="T:System.Array" /> type has three instance methods defined on it. |
| 43 |
While some programming languages allow direct access to these methods, they are |
| 44 |
primarily intended to be called by the output of compilers based on language |
| 45 |
syntax that deals with arrays. </para> |
| 46 |
<list type="bullet"> |
| 47 |
<item> |
| 48 |
<term> |
| 49 |
<para> |
| 50 |
<c>Get</c>: Takes as many <see cref="T:System.Int32" /> arguments as the array |
| 51 |
has dimensions and returns the value stored at the given index. It throws a |
| 52 |
<see cref="T:System.IndexOutOfRangeException" /> |
| 53 |
exception for invalid indices. </para> |
| 54 |
</term> |
| 55 |
</item> |
| 56 |
<item> |
| 57 |
<term> |
| 58 |
<para> |
| 59 |
<c>Set</c>: Takes as many <see cref="T:System.Int32" /> arguments as the array |
| 60 |
has dimensions, plus one additional argument (the last argument) which has the |
| 61 |
same type as an array element. It stores the final value in the specified |
| 62 |
index of the array. It throws a <see cref="T:System.IndexOutOfRangeException" /> |
| 63 |
exception for invalid indices. </para> |
| 64 |
</term> |
| 65 |
</item> |
| 66 |
<item> |
| 67 |
<term> |
| 68 |
<para> |
| 69 |
<c>Address</c>: Takes as many <see cref="T:System.Int32" /> arguments as the |
| 70 |
array has dimensions and returns the address of the element at the given index. |
| 71 |
It throws a <see cref="T:System.IndexOutOfRangeException" /> |
| 72 |
exception for invalid indices. </para> |
| 73 |
</term> |
| 74 |
</item> |
| 75 |
</list> |
| 76 |
<para>In addition, every specific <see cref="T:System.Array" /> type has a constructor on it that takes as many non-negative |
| 77 |
<see cref="T:System.Int32" /> |
| 78 |
arguments as the array has dimensions. The arguments specify the |
| 79 |
number of elements in each dimension, and a lower bound of 0. Thus, a |
| 80 |
two-dimensional array of <see cref="T:System.Int32" /> objects would have a constructor that could be called with |
| 81 |
<c>(2, 4)</c> as its arguments to create an array of eight zeros with the first dimension indexed |
| 82 |
with 0 and 1 and the second dimension indexed with 0, 1, 2, and 3. </para> |
| 83 |
<para>For all specific array types except vectors (i.e. those |
| 84 |
permitted to have non-zero lower bounds and those with more than one dimension) |
| 85 |
there is an additional constructor. It takes twice as many arguments as the |
| 86 |
array has dimensions. The arguments are considered in pairs, with the first of |
| 87 |
the pair specifying the lower bound for that dimension and the second specifying |
| 88 |
the total number of elements in that dimension. Thus, a two-dimensional array |
| 89 |
of <see cref="T:System.Int32" /> |
| 90 |
|
| 91 |
objects would also have a constructor that could be called with <c>(-1, 2, 1, 3)</c> as its arguments, |
| 92 |
specifying an array of 6 zeros, with the first dimension indexed by -1 and 0, |
| 93 |
and the second dimension indexed by 1, 2, and 3. </para> |
| 94 |
<para>Enumeration over an array occurs in ascending row-major order, starting from the first element. (For example, a 2x3 array is traversed in the order [0,0], [0,1], [0,2], [1,0], [1,1], and [1,2].)</para> |
| 95 |
<para>Parallel implementation of methods taking a <see cref="T:System.Predicate" /> argument are not permitted.</para> |
| 96 |
</remarks> |
| 97 |
</Docs> |
| 98 |
<Members> |
| 99 |
<Member MemberName=".ctor"> |
| 100 |
<MemberSignature Language="C#" Value="public Array ();" /> |
| 101 |
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /> |
| 102 |
<MemberType>Constructor</MemberType> |
| 103 |
<AssemblyInfo> |
| 104 |
<AssemblyVersion>0.0.0.0</AssemblyVersion> |
| 105 |
</AssemblyInfo> |
| 106 |
<Parameters /> |
| 107 |
<Docs> |
| 108 |
<summary>Constructs a new instance of the <see cref="T:System.Array" /> class.</summary> |
| 109 |
<remarks>To be added.</remarks> |
| 110 |
</Docs> |
| 111 |
</Member> |
| 112 |
<Member MemberName="AsReadOnly<T>"> |
| 113 |
<MemberSignature Language="C#" Value="public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T> (T[] array);" /> |
| 114 |
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.ObjectModel.ReadOnlyCollection`1<!!T> AsReadOnly<T>(!!T[] array) cil managed" /> |
| 115 |
<MemberType>Method</MemberType> |
| 116 |
<AssemblyInfo> |
| 117 |
<AssemblyVersion>0.0.0.0</AssemblyVersion> |
| 118 |
</AssemblyInfo> |
| 119 |
<ReturnValue> |
| 120 |
<ReturnType>System.Collections.ObjectModel.ReadOnlyCollection<T></ReturnType> |
| 121 |
</ReturnValue> |
| 122 |
<TypeParameters> |
| 123 |
<TypeParameter Name="T" /> |
| 124 |
</TypeParameters> |
| 125 |
<Parameters> |
| 126 |
<Parameter Name="array" Type="T[]" /> |
| 127 |
</Parameters> |
| 128 |
<Docs> |
| 129 |
<typeparam name="T">To be added.</typeparam> |
| 130 |
<param name="array">To be added.</param> |
| 131 |
<summary>To be added.</summary> |
| 132 |
<returns>To be added.</returns> |
| 133 |
<remarks>To be added.</remarks> |
| 134 |
</Docs> |
| 135 |
</Member> |
| 136 |
<Member MemberName="ConvertAll<TInput,TOutput>"> |
| 137 |
<MemberSignature Language="C#" Value="public static TOutput[] ConvertAll<TInput,TOutput> (TInput[] array, Converter<TInput,TOutput> converter);" /> |
| 138 |
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!TOutput[] ConvertAll<TInput, TOutput>(!!TInput[] array, class System.Converter`2<!!TInput, !!TOutput> converter) cil managed" /> |
| 139 |
<MemberType>Method</MemberType> |
| 140 |
<AssemblyInfo> |
| 141 |
<AssemblyVersion>0.0.0.0</AssemblyVersion> |
| 142 |
</AssemblyInfo> |
| 143 |
<ReturnValue> |
| 144 |
<ReturnType>TOutput[]</ReturnType> |
| 145 |
</ReturnValue> |
| 146 |
<TypeParameters> |
| 147 |
<TypeParameter Name="TInput" /> |
| 148 |
<TypeParameter Name="TOutput" /> |
| 149 |
</TypeParameters> |
| 150 |
<Parameters> |
| 151 |
<Parameter Name="array" Type="TInput[]" /> |
| 152 |
<Parameter Name="converter" Type="System.Converter<TInput,TOutput>" /> |
| 153 |
</Parameters> |
| 154 |
<Docs> |
| 155 |
<typeparam name="TInput">To be added.</typeparam> |
| 156 |
<typeparam name="TOutput">To be added.</typeparam> |
| 157 |
<param name="array">The one-dimensional array to convert.</param> |
| 158 |
<param name="converter"> |
| 159 |
<para>A <see cref="T:System.Converter<T,U>" /> that converts each element from one type to another type.</para> |
| 160 |
</param> |
| 161 |
<summary> |
| 162 |
<para>Converts an array of one type to an array of another type.</para> |
| 163 |
</summary> |
| 164 |
<returns> |
| 165 |
<para>A new array of the target type containing the converted elements from <paramref name="array" />.</para> |
| 166 |
</returns> |
| 167 |
<remarks> |
| 168 |
<para>The <see cref="T:System.Converter<T,U>" /> is a delegate that converts an array element to the target type. The elements of <paramref name="array" /> are individually passed to this converter, and the converted elements are saved in the new array. The source array remains unchanged.</para> |
| 169 |
</remarks> |
| 170 |
<exception cref="T:System.ArgumentNullException"> |
| 171 |
<paramref name="array" /> is <see langword="null" /> or <paramref name="converter" /> is <see langword="null" />.</exception> |
| 172 |
</Docs> |
| 173 |
</Member> |
| 174 |
<Member MemberName="Resize<T>"> |
| 175 |
<MemberSignature Language="C#" Value="public static void Resize<T> (ref T[] array, int newSize);" /> |
| 176 |
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Resize<T>(!!T[]& array, int32 newSize) cil managed" /> |
| 177 |
<MemberType>Method</MemberType> |
| 178 |
<AssemblyInfo> |
| 179 |
<AssemblyVersion>0.0.0.0</AssemblyVersion> |
| 180 |
</AssemblyInfo> |
| 181 |
<ReturnValue> |
| 182 |
<ReturnType>System.Void</ReturnType> |
| 183 |
</ReturnValue> |
| 184 |
<TypeParameters> |
| 185 |
<TypeParameter Name="T" /> |
| 186 |
</TypeParameters> |
| 187 |
<Parameters> |
| 188 |
<Parameter Name="array" Type="T[]" RefType="ref" /> |
| 189 |
<Parameter Name="newSize" Type="System.Int32" /> |
| 190 |
</Parameters> |
| 191 |
<Docs> |
| 192 |
<typeparam name="T">To be added.</typeparam> |
| 193 |
<param name="array">To be added.</param> |
| 194 |
<param name="newSize">To be added.</param> |
| 195 |
<summary>To be added.</summary> |
| 196 |
<remarks>To be added.</remarks> |
| 197 |
</Docs> |
| 198 |
</Member> |
| 199 |
</Members> |
| 200 |
</Type> |