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.

  • c The 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.

  • capacity The number of elements that the new list can initially store.

public static ArrayList Adapter( IList list )

Creates an wrapper for a specific .

  • list The to wrap.
  • Returns The wrapper around the .

public int Add( object value )

Adds an object to the end of the .

  • value The 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 .

  • c The 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.

  • index The zero-based starting index of the range to search.
  • count The length of the range to search.
  • value The to locate. The value can be .
  • comparer The 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.

  • value The 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.

  • value The to locate. The value can be .
  • comparer The 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 .

  • item The 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.

  • array The 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.

  • array The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.
  • arrayIndex The 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.

  • index The zero-based index in the source at which copying begins.
  • array The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.
  • arrayIndex The zero-based index in at which copying begins.
  • count The 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.

  • list The to wrap.
  • Returns An wrapper with a fixed size.

public static IList FixedSize( IList list )

Returns an wrapper with a fixed size.

  • list The 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 .

  • index The zero-based starting index of the section that the enumerator should refer to.
  • count The 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 .

  • index The zero-based index at which the range starts.
  • count The 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 .

  • value The 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.

  • value The to locate in the . The value can be .
  • startIndex The 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.

  • value The to locate in the . The value can be .
  • startIndex The zero-based starting index of the search. 0 (zero) is valid in an empty list.
  • count The 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.

  • index The zero-based index at which should be inserted.
  • value The 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.

  • index The zero-based index at which the new elements should be inserted.
  • c The 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 .

  • value The 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.

  • value The to locate in the . The value can be .
  • startIndex The 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.

  • value The to locate in the . The value can be .
  • startIndex The zero-based starting index of the backward search.
  • count The 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.

  • list The to wrap.
  • Returns A read-only wrapper around .

public static IList ReadOnly( IList list )

Returns a read-only wrapper.

  • list The to wrap.
  • Returns A read-only wrapper around .

public void Remove( object obj )

Removes the first occurrence of a specific object from the .

  • obj The to remove from the . The value can be .

public void RemoveAt( int index )

Removes the element at the specified index of the .

  • index The zero-based index of the element to remove.

public void RemoveRange( int index, int count )

Removes a range of elements from the .

  • index The zero-based starting index of the range of elements to remove.
  • count The number of elements to remove.

public static ArrayList Repeat( object value, int count )

Returns an whose elements are copies of the specified value.

  • value The to copy multiple times in the new . The value can be .
  • count The 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.

  • index The zero-based starting index of the range to reverse.
  • count The 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 .

  • index The zero-based index at which to start copying the elements of .
  • c The 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.

  • comparer The 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.

  • index The zero-based starting index of the range to sort.
  • count The length of the range to sort.
  • comparer The 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).

  • list The to synchronize.
  • Returns An wrapper that is synchronized (thread safe).

public static IList Synchronized( IList list )

Returns an wrapper that is synchronized (thread safe).

  • list The 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.

  • type The 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.