ArrayList

ArrayList CF 1.0, ECMA 1.0, serializable

System.Collections (mscorlib.dll) class

This class is similar to an array, but it can grow or shrink as needed. The Capacity property returns the maximum number of elements the ArrayList can hold. You can reduce the size by setting Capacity explicitly or using the TrimToSize( ) method. An ArrayList can be constructed empty or with an integer argument that sets its initial size. You can also pass the constructor an object that implements ICollection to fill the ArrayList with the contents of that object.

A number of methods are provided to modify the contents of the ArrayList . The Add( ) and AddRange( ) methods add elements to the end of the list. Insert( ) and InsertRange( ) add new elements at a specified location within the list.

 public class  ArrayList  : IList, ICollection, IEnumerable, ICloneable {  // Public Constructors  public  ArrayList  ( );    public  ArrayList  (ICollection   c   );    public  ArrayList  (int   capacity   );  // Public Instance Properties  public virtual int  Capacity  {set; get; }    public virtual int  Count  {get; }  // implements ICollection  public virtual bool  IsFixedSize  {get; }  // implements IList  public virtual bool  IsReadOnly  {get; }  // implements IList  public virtual bool  IsSynchronized  {get; }  // implements ICollection  public virtual object  SyncRoot  {get; }  // implements ICollection  public virtual object  this  [object   key   ]{set; get; }  // implements IList   // Public Static Methods  public static ArrayList  Adapter  (IList   list   );    public static ArrayList  FixedSize  (ArrayList   list   );    public static IList  FixedSize  (IList   list   );    public static ArrayList  ReadOnly  (ArrayList   list   );    public static IList  ReadOnly  (IList   list   );    public static ArrayList  Repeat  (object   value   , int   count   );    public static ArrayList  Synchronized  (ArrayList   list   );    public static IList  Synchronized  (IList   list   );  // Public Instance Methods  public virtual int  Add  (object   value   );  // implements IList  public virtual void  AddRange  (ICollection   c   );    public virtual int  BinarySearch  (int   index   , int   count   , object   value   , IComparer   comparer   );    public virtual int  BinarySearch  (object   value   );    public virtual int  BinarySearch  (object   value   , IComparer   comparer   );    public virtual void  Clear  ( );  // implements IList  public virtual object  Clone  ( );  // implements ICloneable  public virtual bool  Contains  (object   item   );  // implements IList  public virtual void  CopyTo  (Array   array   );    public virtual void  CopyTo  (Array   array   , int   arrayIndex   );  // implements ICollection  public virtual void  CopyTo  (int   index   , Array   array   , int   arrayIndex   , int   count   );    public virtual IEnumerator  GetEnumerator  ( );  // implements IEnumerable  public virtual IEnumerator  GetEnumerator  (int   index   , int   count   );    public virtual ArrayList  GetRange  (int   index   , int   count   );    public virtual int  IndexOf  (object   value   );  // implements IList  public virtual int  IndexOf  (object   value   , int   startIndex   );    public virtual int  IndexOf  (object   value   , int   startIndex   , int   count   );    public virtual void  Insert  (int   index   , object   value   );  // implements IList  public virtual void  InsertRange  (int   index   , ICollection   c   );    public virtual int  LastIndexOf  (object   value   );    public virtual int  LastIndexOf  (object   value   , int   startIndex   );    public virtual int  LastIndexOf  (object   value   , int   startIndex   , int   count   );    public virtual void  Remove  (object   obj   );  // implements IList  public virtual void  RemoveAt  (int   index   );  // implements IList  public virtual void  RemoveRange  (int   index   , int   count   );    public virtual void  Reverse  ( );    public virtual void  Reverse  (int   index   , int   count   );    public virtual void  SetRange  (int   index   , ICollection   c   );    public virtual void  Sort  ( );    public virtual void  Sort  (IComparer   comparer   );    public virtual void  Sort  (int   index   , int   count   , IComparer   comparer   );    public virtual Array  ToArray  (Type   type   );    public virtual object[ ]  ToArray  ( );    public virtual void  TrimToSize  ( ); } 

Returned By

CollectionBase.InnerList , ReadOnlyCollectionBase.InnerList , System.Net.WebProxy.BypassArrayList



C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net