C# Class InternalSystem.Collections.ArrayList

Inheritance: System.ICloneable
Datei anzeigen Open project: sharpos/SharpOS Class Usage Examples

Public Methods

Method Description
Add ( object item ) : int

Adds an object to the end of the System.Collections.ArrayList.

AddRange ( ICollection collection ) : void

Adds the elements of an System.Collections.ICollection to the end of the System.Collections.ArrayList.

ArrayList ( ) : System.Runtime.InteropServices

Initializes a new instance of the System.Collections.ArrayList class that is empty and has the default initial capacity.

ArrayList ( ICollection collection ) : System.Runtime.InteropServices

Initializes a new instance of the System.Collections.ArrayList class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.

ArrayList ( int capacity ) : System.Runtime.InteropServices

Initializes a new instance of the System.Collections.ArrayList class that is empty and has the specified initial capacity.

Clear ( ) : void

Removes all elements from the System.Collections.ArrayList.

Clone ( ) : object
Contains ( object item ) : bool

Determines whether an element is in the System.Collections.ArrayList.

CopyTo ( Array array ) : void

Copies the entire System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the beginning of the target array.

CopyTo ( Array array, int arrayIndex ) : void

Copies the entire System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the specified index of the target array.

CopyTo ( int index, Array array, int arrayIndex, int count ) : void

Copies a range of elements from the System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the specified index of the target array.

GetEnumerator ( ) : IEnumerator

Returns an enumerator for the entire System.Collections.ArrayList.

GetEnumerator ( int index, int count ) : IEnumerator

Returns an enumerator for a range of elements in the System.Collections.ArrayList.

GetRange ( int index, int count ) : ArrayList

Returns an System.Collections.ArrayList which represents a subset of the elements in the source System.Collections.ArrayList.

IndexOf ( object item ) : int

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the entire System.Collections.ArrayList.

IndexOf ( object item, int startIndex ) : int

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.ArrayList that extends from the specified index to the last element.

IndexOf ( object item, int startIndex, int count ) : int

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.ArrayList that starts at the specified index and contains the specified number of elements.

Insert ( int index, object item ) : void

Inserts an element into the System.Collections.ArrayList at the specified index.

InsertRange ( int index, ICollection collection ) : void

Inserts the elements of a collection into the System.Collections.ArrayList at the specified index.

LastIndexOf ( object item ) : int

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the entire System.Collections.ArrayList.

LastIndexOf ( object item, int startIndex ) : int

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.ArrayList that extends from the first element to the specified index.

LastIndexOf ( object item, int startIndex, int count ) : int

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.ArrayList that contains the specified number of elements and ends at the specified index.

Remove ( object obj ) : void

Removes the first occurrence of a specific object from the System.Collections.ArrayList.

RemoveAt ( int index ) : void

Removes the element at the specified index of the System.Collections.ArrayList.

RemoveRange ( int index, int count ) : void

Removes a range of elements from the System.Collections.ArrayList.

Repeat ( object item, int count ) : ArrayList

Returns an System.Collections.ArrayList whose elements are copies of the specified item.

Reverse ( ) : void

Reverses the order of the elements in the entire System.Collections.ArrayList.

Reverse ( int index, int count ) : void

Reverses the order of the elements in the specified range.

ToArray ( ) : object[]

Copies the elements of the System.Collections.ArrayList to a new System.Object array.

TrimToSize ( ) : void

Sets the capacity to the actual number of elements in the System.Collections.ArrayList.

this ( int index ) : object

Gets or sets the element at the specified index.

Private Methods

Method Description
EnsureAdditionalCapacity ( int count ) : void
SetCapacity ( int value ) : void

Method Details

Add() public method

Adds an object to the end of the System.Collections.ArrayList.
/// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public Add ( object item ) : int
item object /// The System.Object to be added to the end of the System.Collections.ArrayList. /// The item can be null. ///
return int

AddRange() public method

Adds the elements of an System.Collections.ICollection to the end of the System.Collections.ArrayList.
/// collection is null. /// /// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public AddRange ( ICollection collection ) : void
collection ICollection /// The System.Collections.ICollection whose elements should be added to the /// end of the System.Collections.ArrayList. The collection itself cannot be /// null, but it can contain elements that are null. ///
return void

ArrayList() public method

Initializes a new instance of the System.Collections.ArrayList class that is empty and has the default initial capacity.
public ArrayList ( ) : System.Runtime.InteropServices
return System.Runtime.InteropServices

ArrayList() public method

Initializes a new instance of the System.Collections.ArrayList class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.
/// collection is null. ///
public ArrayList ( ICollection collection ) : System.Runtime.InteropServices
collection ICollection /// The System.Collections.ICollection whose elements are copied to the new list. ///
return System.Runtime.InteropServices

ArrayList() public method

Initializes a new instance of the System.Collections.ArrayList class that is empty and has the specified initial capacity.
/// capacity is less than zero. ///
public ArrayList ( int capacity ) : System.Runtime.InteropServices
capacity int /// The number of elements that the new list can initially store. ///
return System.Runtime.InteropServices

Clear() public method

Removes all elements from the System.Collections.ArrayList.
/// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public Clear ( ) : void
return void

Clone() public method

public Clone ( ) : object
return object

Contains() public method

Determines whether an element is in the System.Collections.ArrayList.
public Contains ( object item ) : bool
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
return bool

CopyTo() public method

Copies the entire System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the beginning of the target array.
/// array is null. /// /// array is multidimensional.-or- The number of elements in the source System.Collections.ArrayList /// is greater than the number of elements that the destination array can contain. /// /// The type of the source System.Collections.ArrayList cannot be cast automatically /// to the type of the destination array. ///
public CopyTo ( Array array ) : void
array Array /// The one-dimensional System.Array that is the destination of the elements /// copied from System.Collections.ArrayList. The System.Array must have zero-based /// indexing. ///
return void

CopyTo() public method

Copies the entire System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the specified index of the target array.
/// array is null. /// /// arrayIndex is less than zero. /// /// array is multidimensional.-or- arrayIndex is equal to or greater than the /// length of array.-or- The number of elements in the source System.Collections.ArrayList /// is greater than the available space from arrayIndex to the end of the destination /// array. /// /// The type of the source System.Collections.ArrayList cannot be cast automatically /// to the type of the destination array. ///
public CopyTo ( Array array, int arrayIndex ) : void
array Array /// The one-dimensional System.Array that is the destination of the elements /// copied from System.Collections.ArrayList. The System.Array must have zero-based /// indexing. ///
arrayIndex int /// The zero-based index in array at which copying begins. ///
return void

CopyTo() public method

Copies a range of elements from the System.Collections.ArrayList to a compatible one-dimensional System.Array, starting at the specified index of the target array.
/// array is null. /// /// index is less than zero.-or- arrayIndex is less than zero.-or- count is less /// than zero. /// /// array is multidimensional.-or- index is equal to or greater than the System.Collections.ArrayList.Count /// of the source System.Collections.ArrayList.-or- arrayIndex is equal to or /// greater than the length of array.-or- The number of elements from index to /// the end of the source System.Collections.ArrayList is greater than the available /// space from arrayIndex to the end of the destination array. /// /// The type of the source System.Collections.ArrayList cannot be cast automatically /// to the type of the destination array. ///
public CopyTo ( int index, Array array, int arrayIndex, int count ) : void
index int /// The zero-based index in the source System.Collections.ArrayList at which /// copying begins. ///
array Array /// The one-dimensional System.Array that is the destination of the elements /// copied from System.Collections.ArrayList. The System.Array must have zero-based /// indexing. ///
arrayIndex int /// The zero-based index in array at which copying begins. ///
count int /// The number of elements to copy. ///
return void

GetEnumerator() public method

Returns an enumerator for the entire System.Collections.ArrayList.
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetEnumerator() public method

Returns an enumerator for a range of elements in the System.Collections.ArrayList.
/// index is less than zero.-or- count is less than zero. /// /// index and count do not specify a valid range in the System.Collections.ArrayList. ///
public GetEnumerator ( int index, int count ) : IEnumerator
index int /// The zero-based starting index of the System.Collections.ArrayList section /// that the enumerator should refer to. ///
count int /// The number of elements in the System.Collections.ArrayList section that the /// enumerator should refer to. ///
return IEnumerator

GetRange() public method

Returns an System.Collections.ArrayList which represents a subset of the elements in the source System.Collections.ArrayList.
/// index is less than zero.-or- count is less than zero. /// /// index and count do not denote a valid range of elements in the System.Collections.ArrayList. ///
public GetRange ( int index, int count ) : ArrayList
index int /// The zero-based System.Collections.ArrayList index at which the range starts. ///
count int /// The number of elements in the range. ///
return ArrayList

IndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the entire System.Collections.ArrayList.
public IndexOf ( object item ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
return int

IndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.ArrayList that extends from the specified index to the last element.
/// startIndex is outside the range of valid indexes for the System.Collections.ArrayList. ///
public IndexOf ( object item, int startIndex ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
startIndex int /// The zero-based starting index of the search. ///
return int

IndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.ArrayList that starts at the specified index and contains the specified number of elements.
/// startIndex is outside the range of valid indexes for the System.Collections.ArrayList.-or- /// count is less than zero.-or- startIndex and count do not specify a valid /// section in the System.Collections.ArrayList. ///
public IndexOf ( object item, int startIndex, int count ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
startIndex int /// The zero-based starting index of the search. ///
count int /// The number of elements in the section to search. ///
return int

Insert() public method

Inserts an element into the System.Collections.ArrayList at the specified index.
/// index is less than zero.-or- index is greater than System.Collections.ArrayList.Count. /// /// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public Insert ( int index, object item ) : void
index int /// The zero-based index at which item should be inserted. ///
item object /// The System.Object to insert. The item can be null. ///
return void

InsertRange() public method

Inserts the elements of a collection into the System.Collections.ArrayList at the specified index.
/// collection is null. /// /// index is less than zero.-or- index is greater than System.Collections.ArrayList.Count. /// /// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public InsertRange ( int index, ICollection collection ) : void
index int /// The zero-based index at which the new elements should be inserted. ///
collection ICollection /// The System.Collections.ICollection whose elements should be inserted into /// the System.Collections.ArrayList. The collection itself cannot be null, but /// it can contain elements that are null. ///
return void

LastIndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the entire System.Collections.ArrayList.
public LastIndexOf ( object item ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
return int

LastIndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.ArrayList that extends from the first element to the specified index.
/// startIndex is outside the range of valid indexes for the System.Collections.ArrayList. ///
public LastIndexOf ( object item, int startIndex ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
startIndex int /// The zero-based starting index of the backward search. ///
return int

LastIndexOf() public method

Searches for the specified System.Object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.ArrayList that contains the specified number of elements and ends at the specified index.
/// startIndex is outside the range of valid indexes for the System.Collections.ArrayList.-or- /// count is less than zero.-or- startIndex and count do not specify a valid /// section in the System.Collections.ArrayList. ///
public LastIndexOf ( object item, int startIndex, int count ) : int
item object /// The System.Object to locate in the System.Collections.ArrayList. The item /// can be null. ///
startIndex int /// The zero-based starting index of the backward search. ///
count int /// The number of elements in the section to search. ///
return int

Remove() public method

Removes the first occurrence of a specific object from the System.Collections.ArrayList.
/// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public Remove ( object obj ) : void
obj object /// The System.Object to remove from the System.Collections.ArrayList. The item /// can be null. ///
return void

RemoveAt() public method

Removes the element at the specified index of the System.Collections.ArrayList.
/// index is less than zero.-or- index is equal to or greater than System.Collections.ArrayList.Count. /// /// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public RemoveAt ( int index ) : void
index int /// The zero-based index of the element to remove. ///
return void

RemoveRange() public method

Removes a range of elements from the System.Collections.ArrayList.
/// index is less than zero.-or- count is less than zero. /// /// index and count do not denote a valid range of elements in the System.Collections.ArrayList. /// /// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public RemoveRange ( int index, int count ) : void
index int /// The zero-based starting index of the range of elements to remove. ///
count int /// The number of elements to remove. ///
return void

Repeat() public static method

Returns an System.Collections.ArrayList whose elements are copies of the specified item.
/// count is less than zero. ///
public static Repeat ( object item, int count ) : ArrayList
item object /// The System.Object to copy multiple times in the new System.Collections.ArrayList. /// The item can be null. ///
count int /// The number of times item should be copied. ///
return ArrayList

Reverse() public method

Reverses the order of the elements in the entire System.Collections.ArrayList.
/// The System.Collections.ArrayList is read-only. ///
public Reverse ( ) : void
return void

Reverse() public method

Reverses the order of the elements in the specified range.
/// index is less than zero.-or- count is less than zero. /// /// index and count do not denote a valid range of elements in the System.Collections.ArrayList. /// /// The System.Collections.ArrayList is read-only. ///
public Reverse ( int index, int count ) : void
index int /// The zero-based starting index of the range to reverse. ///
count int /// The number of elements in the range to reverse. ///
return void

ToArray() public method

Copies the elements of the System.Collections.ArrayList to a new System.Object array.
public ToArray ( ) : object[]
return object[]

TrimToSize() public method

Sets the capacity to the actual number of elements in the System.Collections.ArrayList.
/// The System.Collections.ArrayList is read-only.-or- The System.Collections.ArrayList /// has a fixed size. ///
public TrimToSize ( ) : void
return void

this() public method

Gets or sets the element at the specified index.
/// index is less than zero.-or- index is equal to or greater than System.Collections.ArrayList.Count. ///
public this ( int index ) : object
index int /// The zero-based index of the element to get or set. ///
return object