class ArrayList
in global :: System . Collections
Implements the interface using an array whose size is dynamically increased as required.
public ArrayList( ICollection c )
Initializes a new instance of the class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.
cThe whose elements are copied to the new list.
public ArrayList( int capacity )
Initializes a new instance of the class that is empty and has the specified initial capacity.
capacityThe number of elements that the new list can initially store.
public static ArrayList Adapter( IList list )
Creates an wrapper for a specific .
listThe to wrap.- Returns The wrapper around the .
public int Add( object value )
Adds an object to the end of the .
valueThe to be added to the end of the . The value can be .- Returns The index at which the has been added.
public void AddRange( ICollection c )
Adds the elements of an to the end of the .
cThe whose elements should be added to the end of the . The collection itself cannot be , but it can contain elements that are .
public int BinarySearch( int index, int count, object value, IComparer comparer )
Searches a range of elements in the sorted for an element using the specified comparer and returns the zero-based index of the element.
indexThe zero-based starting index of the range to search.countThe length of the range to search.valueThe to locate. The value can be .comparerThe implementation to use when comparing elements. -or- to use the default comparer that is the implementation of each element.- Returns The zero-based index of in the sorted , if is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than or, if there is no larger element, the bitwise complement of .
public int BinarySearch( object value )
Searches the entire sorted for an element using the default comparer and returns the zero-based index of the element.
valueThe to locate. The value can be .- Returns The zero-based index of in the sorted , if is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than or, if there is no larger element, the bitwise complement of .
public int BinarySearch( object value, IComparer comparer )
Searches the entire sorted for an element using the specified comparer and returns the zero-based index of the element.
valueThe to locate. The value can be .comparerThe implementation to use when comparing elements. -or- to use the default comparer that is the implementation of each element.- Returns The zero-based index of in the sorted , if is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than or, if there is no larger element, the bitwise complement of .
public int Capacity { get; set; }
Gets or sets the number of elements that the can contain.
- Returns The number of elements that the can contain.
public bool Contains( object item )
Determines whether an element is in the .
itemThe to locate in the . The value can be .- Returns if is found in the ; otherwise, .
public void CopyTo( Array array )
Copies the entire to a compatible one-dimensional , starting at the beginning of the target array.
arrayThe one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.
public void CopyTo( Array array, int arrayIndex )
Copies the entire to a compatible one-dimensional , starting at the specified index of the target array.
arrayThe one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.arrayIndexThe zero-based index in at which copying begins.
public void CopyTo( int index, Array array, int arrayIndex, int count )
Copies a range of elements from the to a compatible one-dimensional , starting at the specified index of the target array.
indexThe zero-based index in the source at which copying begins.arrayThe one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.arrayIndexThe zero-based index in at which copying begins.countThe number of elements to copy.
public int Count { get; }
Gets the number of elements actually contained in the .
- Returns The number of elements actually contained in the .
public static ArrayList FixedSize( ArrayList list )
Returns an wrapper with a fixed size.
listThe to wrap.- Returns An wrapper with a fixed size.
public static IList FixedSize( IList list )
Returns an wrapper with a fixed size.
listThe to wrap.- Returns An wrapper with a fixed size.
public IEnumerator GetEnumerator( int index, int count )
Returns an enumerator for a range of elements in the .
indexThe zero-based starting index of the section that the enumerator should refer to.countThe number of elements in the section that the enumerator should refer to.- Returns An for the specified range of elements in the .
public ArrayList GetRange( int index, int count )
Returns an which represents a subset of the elements in the source .
indexThe zero-based index at which the range starts.countThe number of elements in the range.- Returns An which represents a subset of the elements in the source .
public int IndexOf( object value )
Searches for the specified and returns the zero-based index of the first occurrence within the entire .
valueThe to locate in the . The value can be .- Returns The zero-based index of the first occurrence of within the entire , if found; otherwise, -1.
public int IndexOf( object value, int startIndex )
Searches for the specified and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element.
valueThe to locate in the . The value can be .startIndexThe zero-based starting index of the search. 0 (zero) is valid in an empty list.- Returns The zero-based index of the first occurrence of within the range of elements in the that extends from to the last element, if found; otherwise, -1.
public int IndexOf( object value, int startIndex, int count )
Searches for the specified and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements.
valueThe to locate in the . The value can be .startIndexThe zero-based starting index of the search. 0 (zero) is valid in an empty list.countThe number of elements in the section to search.- Returns The zero-based index of the first occurrence of within the range of elements in the that starts at and contains number of elements, if found; otherwise, -1.
public void Insert( int index, object value )
Inserts an element into the at the specified index.
indexThe zero-based index at which should be inserted.valueThe to insert. The value can be .
public void InsertRange( int index, ICollection c )
Inserts the elements of a collection into the at the specified index.
indexThe zero-based index at which the new elements should be inserted.cThe whose elements should be inserted into the . The collection itself cannot be , but it can contain elements that are .
public bool IsFixedSize { get; }
Gets a value indicating whether the has a fixed size.
- Returns if the has a fixed size; otherwise, . The default is .
public bool IsReadOnly { get; }
Gets a value indicating whether the is read-only.
- Returns if the is read-only; otherwise, . The default is .
public bool IsSynchronized { get; }
Gets a value indicating whether access to the is synchronized (thread safe).
- Returns if access to the is synchronized (thread safe); otherwise, . The default is .
public int LastIndexOf( object value )
Searches for the specified and returns the zero-based index of the last occurrence within the entire .
valueThe to locate in the . The value can be .- Returns The zero-based index of the last occurrence of within the entire the , if found; otherwise, -1.
public int LastIndexOf( object value, int startIndex )
Searches for the specified and returns the zero-based index of the last occurrence within the range of elements in the that extends from the first element to the specified index.
valueThe to locate in the . The value can be .startIndexThe zero-based starting index of the backward search.- Returns The zero-based index of the last occurrence of within the range of elements in the that extends from the first element to , if found; otherwise, -1.
public int LastIndexOf( object value, int startIndex, int count )
Searches for the specified and returns the zero-based index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index.
valueThe to locate in the . The value can be .startIndexThe zero-based starting index of the backward search.countThe number of elements in the section to search.- Returns The zero-based index of the last occurrence of within the range of elements in the that contains number of elements and ends at , if found; otherwise, -1.
public static ArrayList ReadOnly( ArrayList list )
Returns a read-only wrapper.
listThe to wrap.- Returns A read-only wrapper around .
public static IList ReadOnly( IList list )
Returns a read-only wrapper.
listThe to wrap.- Returns A read-only wrapper around .
public void Remove( object obj )
Removes the first occurrence of a specific object from the .
objThe to remove from the . The value can be .
public void RemoveAt( int index )
Removes the element at the specified index of the .
indexThe zero-based index of the element to remove.
public void RemoveRange( int index, int count )
Removes a range of elements from the .
indexThe zero-based starting index of the range of elements to remove.countThe number of elements to remove.
public static ArrayList Repeat( object value, int count )
Returns an whose elements are copies of the specified value.
valueThe to copy multiple times in the new . The value can be .countThe number of times should be copied.- Returns An with number of elements, all of which are copies of .
public void Reverse( int index, int count )
Reverses the order of the elements in the specified range.
indexThe zero-based starting index of the range to reverse.countThe number of elements in the range to reverse.
public void SetRange( int index, ICollection c )
Copies the elements of a collection over a range of elements in the .
indexThe zero-based index at which to start copying the elements of .cThe whose elements to copy to the . The collection itself cannot be , but it can contain elements that are .
public void Sort( IComparer comparer )
Sorts the elements in the entire using the specified comparer.
comparerThe implementation to use when comparing elements. -or- A null reference ( in Visual Basic) to use the implementation of each element.
public void Sort( int index, int count, IComparer comparer )
Sorts the elements in a range of elements in using the specified comparer.
indexThe zero-based starting index of the range to sort.countThe length of the range to sort.comparerThe implementation to use when comparing elements. -or- A null reference ( in Visual Basic) to use the implementation of each element.
public static ArrayList Synchronized( ArrayList list )
Returns an wrapper that is synchronized (thread safe).
listThe to synchronize.- Returns An wrapper that is synchronized (thread safe).
public static IList Synchronized( IList list )
Returns an wrapper that is synchronized (thread safe).
listThe to synchronize.- Returns An wrapper that is synchronized (thread safe).
public object SyncRoot { get; }
Gets an object that can be used to synchronize access to the .
- Returns An object that can be used to synchronize access to the .
public Array ToArray( Type type )
Copies the elements of the to a new array of the specified element type.
typeThe element of the destination array to create and copy elements to.- Returns An array of the specified element type containing copies of the elements of the .
public IEnumerator GetEnumerator( )
😔 No documentation found.
public void Clear( )
😔 No documentation found.
public void Reverse( )
😔 No documentation found.
public object Item { get; set; }
😔 No documentation found.
public object[] ToArray( )
😔 No documentation found.
public void TrimToSize( )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public ArrayList( )
😔 No documentation found.
public void Sort( )
😔 No documentation found.
public object Clone( )
😔 No documentation found.