CollectionBaseとは? わかりやすく解説

CollectionBase クラス

厳密に指定されコレクションabstract 基本クラス提供します

名前空間: System.Collections
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public MustInherit Class
 CollectionBase
    Implements IList, ICollection, IEnumerable
Dim instance As CollectionBase
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public abstract class CollectionBase : IList,
 ICollection, IEnumerable
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public ref class CollectionBase abstract :
 IList, ICollection, IEnumerable
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public abstract class CollectionBase implements
 IList, ICollection, 
    IEnumerable
SerializableAttribute 
ComVisibleAttribute(true) 
public abstract class CollectionBase implements
 IList, ICollection, 
    IEnumerable
解説解説
使用例使用例

CollectionBase クラス実装し、その実装を使用して Int16 オブジェクトコレクション作成する方法については、次のコード例参照してください

Imports System
Imports System.Collections


Public Class Int16Collection
   Inherits CollectionBase


   Default Public Property
 Item(index As Integer) As
 Int16
      Get
         Return CType(List(index), Int16)
      End Get
      Set
         List(index) = value
      End Set
   End Property


   Public Function Add(value As
 Int16) As Integer
      Return List.Add(value)
   End Function 'Add

   Public Function IndexOf(value As
 Int16) As Integer
      Return List.IndexOf(value)
   End Function 'IndexOf


   Public Sub Insert(index As
 Integer, value As Int16)
      List.Insert(index, value)
   End Sub 'Insert


   Public Sub Remove(value As
 Int16)
      List.Remove(value)
   End Sub 'Remove


   Public Function Contains(value As
 Int16) As Boolean
      ' If value is not of type Int16, this will return false.
      Return List.Contains(value)
   End Function 'Contains


   Protected Overrides Sub
 OnInsert(index As Integer, value As
 Object)
      ' Insert additional code to be run only when inserting values.
   End Sub 'OnInsert


   Protected Overrides Sub
 OnRemove(index As Integer, value As
 Object)
      ' Insert additional code to be run only when removing values.
   End Sub 'OnRemove


   Protected Overrides Sub
 OnSet(index As Integer, oldValue As
 Object, newValue As Object)
      ' Insert additional code to be run only when setting values.
   End Sub 'OnSet


   Protected Overrides Sub
 OnValidate(value As Object)
      If Not GetType(System.Int16).IsAssignableFrom(value.GetType())
 Then
         Throw New ArgumentException("value
 must be of type Int16.", "value")
      End If
   End Sub 'OnValidate 

End Class 'Int16Collection


Public Class SamplesCollectionBase

   Public Shared Sub Main()

      ' Creates and initializes a new CollectionBase.
      Dim myI16 As New Int16Collection()

      ' Adds elements to the collection.
      myI16.Add( 1 )
      myI16.Add( 2 )
      myI16.Add( 3 )
      myI16.Add( 5 )
      myI16.Add( 7 )

      ' Display the contents of the collection using For Each. This
 is the preferred method.
      Console.WriteLine("Contents of the collection (using For
 Each):")
      PrintValues1(myI16)
      
      ' Display the contents of the collection using the enumerator.
      Console.WriteLine("Contents of the collection (using enumerator):")
      PrintValues2(myI16)
      
      ' Display the contents of the collection using the Count property
 and the Item property.
      Console.WriteLine("Initial contents of the collection (using
 Count and Item):")
      PrintIndexAndValues(myI16)
      
      ' Searches the collection with Contains and IndexOf.
      Console.WriteLine("Contains 3: {0}", myI16.Contains(3))
      Console.WriteLine("2 is at index {0}.", myI16.IndexOf(2))
      Console.WriteLine()
      
      ' Inserts an element into the collection at index 3.
      myI16.Insert(3, 13)
      Console.WriteLine("Contents of the collection after inserting
 at index 3:")
      PrintIndexAndValues(myI16)
      
      ' Gets and sets an element using the index.
      myI16(4) = 123
      Console.WriteLine("Contents of the collection after setting
 the element at index 4 to 123:")
      PrintIndexAndValues(myI16)
      
      ' Removes an element from the collection.
      myI16.Remove(2)

      ' Display the contents of the collection using the Count property
 and the Item property.
      Console.WriteLine("Contents of the collection after removing
 the element 2:")
      PrintIndexAndValues(myI16)

    End Sub 'Main


    ' Uses the Count property and the Item property.
    Public Shared Sub PrintIndexAndValues(myCol
 As Int16Collection)
      Dim i As Integer
      For i = 0 To myCol.Count - 1
          Console.WriteLine("   [{0}]:   {1}", i,
 myCol(i))
      Next i
      Console.WriteLine()
    End Sub 'PrintIndexAndValues


    ' Uses the For Each statement which hides the complexity of the
 enumerator.
    ' NOTE: The For Each statement is the preferred way of enumerating
 the contents of a collection.
    Public Shared Sub PrintValues1(myCol
 As Int16Collection)
      Dim i16 As Int16
      For Each i16 In  myCol
          Console.WriteLine("   {0}", i16)
      Next i16
      Console.WriteLine()
    End Sub 'PrintValues1


    ' Uses the enumerator. 
    ' NOTE: The For Each statement is the preferred way of enumerating
 the contents of a collection.
    Public Shared Sub PrintValues2(myCol
 As Int16Collection)
      Dim myEnumerator As System.Collections.IEnumerator
 = myCol.GetEnumerator()
      While myEnumerator.MoveNext()
          Console.WriteLine("   {0}", myEnumerator.Current)
      End While
      Console.WriteLine()
    End Sub 'PrintValues2

End Class 'SamplesCollectionBase


'This code produces the following output.
'
'Contents of the collection (using For Each):
'   1
'   2
'   3
'   5
'   7
'
'Contents of the collection (using enumerator):
'   1
'   2
'   3
'   5
'   7
'
'Initial contents of the collection (using Count and Item):
'   [0]:   1
'   [1]:   2
'   [2]:   3
'   [3]:   5
'   [4]:   7
'
'Contains 3: True
'2 is at index 1.
'
'Contents of the collection after inserting at index 3:
'   [0]:   1
'   [1]:   2
'   [2]:   3
'   [3]:   13
'   [4]:   5
'   [5]:   7
'
'Contents of the collection after setting the element at index 4 to
 123:
'   [0]:   1
'   [1]:   2
'   [2]:   3
'   [3]:   13
'   [4]:   123
'   [5]:   7
'
'Contents of the collection after removing the element 2:
'   [0]:   1
'   [1]:   3
'   [2]:   13
'   [3]:   123
'   [4]:   7

using System;
using System.Collections;

public class Int16Collection : CollectionBase
  {

   public Int16 this[ int
 index ]  {
      get  {
         return( (Int16) List[index] );
      }
      set  {
         List[index] = value;
      }
   }

   public int Add( Int16 value )  {
      return( List.Add( value ) );
   }

   public int IndexOf( Int16 value )  {
      return( List.IndexOf( value ) );
   }

   public void Insert( int
 index, Int16 value )  {
      List.Insert( index, value );
   }

   public void Remove( Int16 value )  {
      List.Remove( value );
   }

   public bool Contains( Int16 value )  {
      // If value is not of type Int16, this will return false.
      return( List.Contains( value ) );
   }

   protected override void OnInsert( int
 index, Object value )  {
      // Insert additional code to be run only when inserting values.
   }

   protected override void OnRemove( int
 index, Object value )  {
      // Insert additional code to be run only when removing values.
   }

   protected override void OnSet( int
 index, Object oldValue, Object newValue )  {
      // Insert additional code to be run only when setting values.
   }

   protected override void OnValidate( Object
 value )  {
      if ( value.GetType() != typeof(System.Int16) )
         throw new ArgumentException( "value must be of type
 Int16.", "value" );
   }

}


public class SamplesCollectionBase  {

   public static void Main()
  {
 
      // Create and initialize a new CollectionBase.
      Int16Collection myI16 = new Int16Collection();

      // Add elements to the collection.
      myI16.Add( (Int16) 1 );
      myI16.Add( (Int16) 2 );
      myI16.Add( (Int16) 3 );
      myI16.Add( (Int16) 5 );
      myI16.Add( (Int16) 7 );

      // Display the contents of the collection using foreach. This
 is the preferred method.
      Console.WriteLine( "Contents of the collection (using
 foreach):" );
      PrintValues1( myI16 );

      // Display the contents of the collection using the enumerator.
      Console.WriteLine( "Contents of the collection (using
 enumerator):" );
      PrintValues2( myI16 );

      // Display the contents of the collection using the Count property
 and the Item property.
      Console.WriteLine( "Initial contents of the collection (using
 Count and Item):" );
      PrintIndexAndValues( myI16 );

      // Search the collection with Contains and IndexOf.
      Console.WriteLine( "Contains 3: {0}", myI16.Contains( 3 ) );
      Console.WriteLine( "2 is at index {0}.", myI16.IndexOf( 2 ) );
      Console.WriteLine();

      // Insert an element into the collection at index 3.
      myI16.Insert( 3, (Int16) 13 );
      Console.WriteLine( "Contents of the collection after inserting at index
 3:" );
      PrintIndexAndValues( myI16 );

      // Get and set an element using the index.
      myI16[4] = 123;
      Console.WriteLine( "Contents of the collection after setting the element
 at index 4 to 123:" );
      PrintIndexAndValues( myI16 );

      // Remove an element from the collection.
      myI16.Remove( (Int16) 2 );

      // Display the contents of the collection using the Count property
 and the Item property.
      Console.WriteLine( "Contents of the collection after removing the element
 2:" );
      PrintIndexAndValues( myI16 );

   }
 
   // Uses the Count property and the Item property.
   public static void PrintIndexAndValues(
 Int16Collection myCol )  {
      for ( int i = 0; i < myCol.Count;
 i++ )
         Console.WriteLine( "   [{0}]:   {1}", i, myCol[i] );
      Console.WriteLine();
   }

   // Uses the foreach statement which hides the complexity of the enumerator.
   // NOTE: The foreach statement is the preferred way of enumerating
 the contents of a collection.
   public static void PrintValues1(
 Int16Collection myCol )  {
      foreach ( Int16 i16 in myCol )
         Console.WriteLine( "   {0}", i16 );
      Console.WriteLine();
   }

   // Uses the enumerator. 
   // NOTE: The foreach statement is the preferred way of enumerating
 the contents of a collection.
   public static void PrintValues2(
 Int16Collection myCol )  {
      System.Collections.IEnumerator myEnumerator = myCol.GetEnumerator();
      while ( myEnumerator.MoveNext() )
         Console.WriteLine( "   {0}", myEnumerator.Current );
      Console.WriteLine();
   }
}


/* 
This code produces the following output.

Contents of the collection (using foreach):
   1
   2
   3
   5
   7

Contents of the collection (using enumerator):
   1
   2
   3
   5
   7

Initial contents of the collection (using Count and Item):
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   5
   [4]:   7

Contains 3: True
2 is at index 1.

Contents of the collection after inserting at index 3:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   5
   [5]:   7

Contents of the collection after setting the element at index 4 to 123:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   123
   [5]:   7

Contents of the collection after removing the element 2:
   [0]:   1
   [1]:   3
   [2]:   13
   [3]:   123
   [4]:   7

*/

#using <System.dll>

using namespace System;
using namespace System::Collections;

public ref class Int16Collection: public
 CollectionBase
{
public:

   property Int16 Item [int]
   {
      Int16 get( int index )
      {
         return ( (Int16)(List[ index ]));
      }

      void set( int index,
 Int16 value )
      {
         List[ index ] = value;
      }
   }
   int Add( Int16 value )
   {
      return (List->Add( value ));
   }

   int IndexOf( Int16 value )
   {
      return (List->IndexOf( value ));
   }

   void Insert( int index, Int16 value )
   {
      List->Insert( index, value );
   }

   void Remove( Int16 value )
   {
      List->Remove( value );
   }

   bool Contains( Int16 value )
   {
      // If value is not of type Int16, this will return false.
      return (List->Contains( value ));
   }

protected:
   virtual void OnInsert( int /*index*/, Object^
 /*value*/ ) override
   {
      // Insert additional code to be run only when inserting values.
   }

   virtual void OnRemove( int /*index*/, Object^
 /*value*/ ) override
   {
      // Insert additional code to be run only when removing values.
   }

   virtual void OnSet( int /*index*/, Object^
 /*oldValue*/, Object^ /*newValue*/ ) override
   {
      // Insert additional code to be run only when setting values.
   }

   virtual void OnValidate( Object^ value ) override
   {
      if ( value->GetType() != Type::GetType( "System.Int16"
 ) )
            throw gcnew ArgumentException( "value must be of type Int16.","value"
 );
   }

};

void PrintIndexAndValues( Int16Collection^ myCol );
void PrintValues2( Int16Collection^ myCol );
int main()
{
   // Create and initialize a new CollectionBase.
   Int16Collection^ myI16 = gcnew Int16Collection;
   
   // Add elements to the collection.
   myI16->Add( (Int16)1 );
   myI16->Add( (Int16)2 );
   myI16->Add( (Int16)3 );
   myI16->Add( (Int16)5 );
   myI16->Add( (Int16)7 );

   // Display the contents of the collection using the enumerator.
   Console::WriteLine( "Contents of the collection (using
 enumerator):" );
   PrintValues2( myI16 );

   // Display the contents of the collection using the Count property
 and the Item property.
   Console::WriteLine( "Initial contents of the collection (using
 Count and Item):" );
   PrintIndexAndValues( myI16 );

   // Search the collection with Contains and IndexOf.
   Console::WriteLine( "Contains 3: {0}", myI16->Contains( 3 ) );
   Console::WriteLine( "2 is at index {0}.", myI16->IndexOf( 2 ) );
   Console::WriteLine();

   // Insert an element into the collection at index 3.
   myI16->Insert( 3, (Int16)13 );
   Console::WriteLine( "Contents of the collection after inserting at index
 3:" );
   PrintIndexAndValues( myI16 );

   // Get and set an element using the index.
   myI16->Item[ 4 ] = 123;
   Console::WriteLine( "Contents of the collection after setting the element
 at index 4 to 123:" );
   PrintIndexAndValues( myI16 );

   // Remove an element from the collection.
   myI16->Remove( (Int16)2 );

   // Display the contents of the collection using the Count property
 and the Item property.
   Console::WriteLine( "Contents of the collection after removing the element
 2:" );
   PrintIndexAndValues( myI16 );
}

// Uses the Count property and the Item property.
void PrintIndexAndValues( Int16Collection^ myCol )
{
   for ( int i = 0; i < myCol->Count;
 i++ )
      Console::WriteLine( "   [{0}]:   {1}", i, myCol->Item[ i ] );
   Console::WriteLine();
}

// Uses the enumerator. 
void PrintValues2( Int16Collection^ myCol )
{
   System::Collections::IEnumerator^ myEnumerator = myCol->GetEnumerator();
   while ( myEnumerator->MoveNext() )
      Console::WriteLine( "   {0}", myEnumerator->Current );

   Console::WriteLine();
}

/* 
This code produces the following output.

Contents of the collection (using enumerator):
   1
   2
   3
   5
   7

Initial contents of the collection (using Count and Item):
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   5
   [4]:   7

Contains 3: True
2 is at index 1.

Contents of the collection after inserting at index 3:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   5
   [5]:   7

Contents of the collection after setting the element at index 4 to 123:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   123
   [5]:   7

Contents of the collection after removing the element 2:
   [0]:   1
   [1]:   3
   [2]:   13
   [3]:   123
   [4]:   7

*/
import System.* ;
import System.Collections.*;
import System.Collections.CollectionBase.*;

public class Int16Collection extends CollectionBase
{
    /** @property 
     */
    public short get_Value(int index)
    {
        short s = System.Convert.ToInt16(get_List().get_Item(index));
        return(s) ; 
    } //get_Value

    /** @property 
     */
    public void set_Value(int
 index,short value)
    {
        get_List().set_Item(index, (Int16)value);
    } //set_Value
   
    public int Add(short value) 
    {
        return get_List().Add((Int16)value);
    } //Add
   
    public int IndexOf(short value)
    {
        return get_List().IndexOf((Int16)value);
    } //IndexOf
     
    public void Insert(int
 index, short value) 
    {
        get_List().Insert(index, (Int16)value);
    } //Insert
   
    public void Remove(short value) 
    {
        get_List().Remove((Int16)value);
    } //Remove
   
    public boolean Contains(short value) 
    {
        // If value is not of type Int16, this will return false.
        return get_List().Contains((Int16)value);
    } //Contains
   
    protected   void OnInsert(int
 index, Object value) 
    {
        // Insert additional code to be run only when inserting values.
    } //OnInsert
    
       protected   void OnRemove(int
 index, Object value) 
    {
        // Insert additional code to be run only when removing values.
    } //OnRemove
    
       protected   void OnSet(int
 index, Object oldValue, Object newValue) 
    {
        // Insert additional code to be run only when setting values.
    } //OnSet
    
    protected   void OnValidate(Object value)
 
    {
        if ( value.GetType() != Type.GetType("System.Int16")
  ) {
            throw new ArgumentException("value must be of
 type Int16.", 
                "value");
        }
    } //OnValidate
} //Int16Collection

public class SamplesCollectionBase
{
    public static void main(String[]
 args)
    {
        // Create and initialize a new CollectionBase.
        Int16Collection myI16 =  new Int16Collection();
      
        // Add elements to the collection.
        myI16.Add((Int16)1);
        myI16.Add((Int16)2);
        myI16.Add((Int16)3);
        myI16.Add((Int16)5);
        myI16.Add((Int16)7);
          
        // Display the contents of the collection using for.
        Console.WriteLine("Contents of the collection (using
 for):");
        PrintValues1(myI16);
          
        // Display the contents of the collection using the enumerator.
        Console.WriteLine("Contents of the collection (using
 enumerator):");
        PrintValues2(myI16);
          
        // Display the contents of the collection using the Count property
 and 
        // the Item property.
        Console.WriteLine("Initial contents of the collection "
            + "(using Count and Item):");
        PrintIndexAndValues(myI16);
          
        // Search the collection with Contains and IndexOf.
        Console.WriteLine("Contains 3: {0}", 
            (System.Boolean)myI16.Contains((Int16)3));
        Console.WriteLine("2 is at index {0}.", 
            (Int16)myI16.IndexOf((Int16)2));
        Console.WriteLine();
          
        // Insert an element into the collection at index 3.
        myI16.Insert(3, (Int16)13);
        Console.WriteLine("Contents of the collection after inserting at"
            + " index 3:");
        PrintIndexAndValues(myI16);
          
        // Get and set an element using the index.
        myI16 .set_Item( 4 ,(Int16)123 );
        Console.WriteLine("Contents of the collection after setting the"
            + " element at index 4 to 123:");
        PrintIndexAndValues(myI16);
          
        // Remove an element from the collection.
        myI16.Remove((Int16)2);
          
        // Display the contents of the collection using the Count property
 and
        // the Item property.
        Console.WriteLine("Contents of the collection after removing the"
            + " element 2:");
        PrintIndexAndValues(myI16);
   } //main
    
   // Uses the Count property and the Item property.
    public static void PrintIndexAndValues(Int16Collection
 myCol) 
    {
        for(int i = 0; i < myCol.get_Count();
 i++) {
            Console.WriteLine("   [{0}]:   {1}", (Int32)i, 
                myCol.get_Item(i));
        } 
        Console.WriteLine();
    } //PrintIndexAndValues
   
    // Uses the for statement which hides the complexity of the enumerator.
    // NOTE: The for statement is the preferred way of enumerating the
 contents 
    // of a collection.
    public static void PrintValues1(Int16Collection
 myCol) 
    {
        for (int iCtr = 0; iCtr < myCol.get_Count();
 iCtr++) {
            Console.WriteLine("   {0}", myCol.get_Item(iCtr));
        }
        Console.WriteLine();
    } //PrintValues1
   
    // Uses the enumerator. 
    // NOTE: The for statement is the preferred way of enumerating the
 contents 
    // of a collection.
    public static void PrintValues2(Int16Collection
 myCol) 
    {
        System.Collections.IEnumerator myEnumerator = myCol.GetEnumerator();
        while(myEnumerator.MoveNext()) {
            Console.WriteLine("   {0}", myEnumerator.get_Current());
        }
        Console.WriteLine();
    } //PrintValues2
} //SamplesCollectionBase

/* 
Contents of the collection (using for):
   1
   2
   3
   5
   7

Contents of the collection (using enumerator):
   1
   2
   3
   5
   7

Initial contents of the collection (using Count and Item):
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   5
   [4]:   7

Contains 3: True
2 is at index 1.

Contents of the collection after inserting at index 3:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   5
   [5]:   7

Contents of the collection after setting the element at index 4 to 123:
   [0]:   1
   [1]:   2
   [2]:   3
   [3]:   13
   [4]:   123
   [5]:   7

Contents of the collection after removing the element 2:
   [0]:   1
   [1]:   3
   [2]:   13
   [3]:   123
   [4]:   7

*/

継承階層継承階層
System.Object
  System.Collections.CollectionBase
     派生クラス
スレッド セーフスレッド セーフ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CollectionBase メンバ
System.Collections 名前空間
ArrayList クラス
System.Collections.IList
ReadOnlyCollectionBase
System.Collections.Generic
その他の技術情報
カルチャを認識しい文字操作実行

CollectionBase コンストラクタ ()

既定初期量を使用して、CollectionBase クラス新しインスタンス初期化します。

名前空間: System.Collections
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As New CollectionBase
protected CollectionBase ()
protected:
CollectionBase ()
protected CollectionBase ()
protected function CollectionBase ()
解説解説

CollectionBase容量は、CollectionBase保持できる要素数になりますCollectionBase要素追加すると、必要に応じて内部配列の再割り当てによって容量自動的に増加します。

コレクションサイズ推定できる場合は、初期量を指定すると、CollectionBase要素追加するときに、サイズ変更操作何度も実行する必要がなくなります

このコンストラクタは O(1) 操作です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

CollectionBase コンストラクタ (Int32)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

容量指定して、CollectionBase クラス新しインスタンス初期化します。

名前空間: System.Collections
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

CollectionBase容量は、CollectionBase保持できる要素数になりますCollectionBase要素追加すると、必要に応じて内部配列の再割り当てによって容量自動的に増加します。

コレクションサイズ推定できる場合は、初期量を指定すると、CollectionBase要素追加するときに、サイズ変更操作何度も実行する必要がなくなります

このコンストラクタは O(n) 操作です (ncapacity)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

CollectionBase コンストラクタ


CollectionBase プロパティ


パブリック プロパティパブリック プロパティ

プロテクト プロパティプロテクト プロパティ
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Collections.IList.Item 指定したインデックスにある要素取得または設定します
参照参照

関連項目

CollectionBase クラス
System.Collections 名前空間
ArrayList クラス
System.Collections.IList
ReadOnlyCollectionBase
System.Collections.Generic

その他の技術情報

カルチャを認識しい文字操作実行

CollectionBase メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 ( Object から継承されます。)
プロテクト メソッド OnClear CollectionBase インスタンス内容消去するときに、追加カスタム プロセス実行します
プロテクト メソッド OnClearComplete CollectionBase インスタンス内容消去した後に、追加カスタム プロセス実行します
プロテクト メソッド OnInsert CollectionBase インスタンス新し要素挿入する前に追加カスタム プロセス実行します
プロテクト メソッド OnInsertComplete CollectionBase インスタンス新し要素挿入した後に、追加カスタム プロセス実行します
プロテクト メソッド OnRemove CollectionBase インスタンスか要素削除するときに、追加カスタム プロセス実行します
プロテクト メソッド OnRemoveComplete CollectionBase インスタンスか要素削除した後に、追加カスタム プロセス実行します
プロテクト メソッド OnSet CollectionBase インスタンスに値を設定する前に追加カスタム プロセス実行します
プロテクト メソッド OnSetComplete CollectionBase インスタンスに値を設定した後に、追加カスタム プロセス実行します
プロテクト メソッド OnValidate 値を検証するときに、追加カスタム プロセス実行します
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Collections.ICollection.CopyTo CollectionBase 全体互換性のある 1 次元Arrayコピーしますコピー操作は、コピー先の配列指定したインデックスから始まります
インターフェイスの明示的な実装 System.Collections.IList.Add CollectionBase末尾オブジェクト追加します
インターフェイスの明示的な実装 System.Collections.IList.Contains CollectionBase特定の要素格納されているかどうか判断します
インターフェイスの明示的な実装 System.Collections.IList.IndexOf 指定した Object検索しCollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックス返します
インターフェイスの明示的な実装 System.Collections.IList.Insert CollectionBase 内の指定したインデックス位置要素挿入します
インターフェイスの明示的な実装 System.Collections.IList.Remove CollectionBase 内で最初に見つかった特定のオブジェクト削除します
参照参照

関連項目

CollectionBase クラス
System.Collections 名前空間
ArrayList クラス
System.Collections.IList
ReadOnlyCollectionBase
System.Collections.Generic

その他の技術情報

カルチャを認識しい文字操作実行

CollectionBase メンバ

厳密に指定されコレクションabstract 基本クラス提供します

CollectionBase データ型公開されるメンバを以下の表に示します


プロテクト コンストラクタプロテクト コンストラクタ
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド OnClear CollectionBase インスタンス内容消去するときに、追加カスタム プロセス実行します
プロテクト メソッド OnClearComplete CollectionBase インスタンス内容消去した後に、追加カスタム プロセス実行します
プロテクト メソッド OnInsert CollectionBase インスタンス新し要素挿入する前に追加カスタム プロセス実行します
プロテクト メソッド OnInsertComplete CollectionBase インスタンス新し要素挿入した後に、追加カスタム プロセス実行します
プロテクト メソッド OnRemove CollectionBase インスタンスか要素削除するときに、追加カスタム プロセス実行します
プロテクト メソッド OnRemoveComplete CollectionBase インスタンスか要素削除した後に、追加カスタム プロセス実行します
プロテクト メソッド OnSet CollectionBase インスタンスに値を設定する前に追加カスタム プロセス実行します
プロテクト メソッド OnSetComplete CollectionBase インスタンスに値を設定した後に、追加カスタム プロセス実行します
プロテクト メソッド OnValidate 値を検証するときに、追加カスタム プロセス実行します
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Collections.ICollection.CopyTo CollectionBase 全体互換性のある 1 次元Arrayコピーしますコピー操作は、コピー先の配列指定したインデックスから始まります
インターフェイスの明示的な実装 System.Collections.IList.Add CollectionBase末尾オブジェクト追加します
インターフェイスの明示的な実装 System.Collections.IList.Contains CollectionBase特定の要素格納されているかどうか判断します
インターフェイスの明示的な実装 System.Collections.IList.IndexOf 指定した Object検索しCollectionBase 全体内で最初に見つかった位置の 0 から始まるインデックス返します
インターフェイスの明示的な実装 System.Collections.IList.Insert CollectionBase 内の指定したインデックス位置要素挿入します
インターフェイスの明示的な実装 System.Collections.IList.Remove CollectionBase 内で最初に見つかった特定のオブジェクト削除します
インターフェイスの明示的な実装 System.Collections.IList.Item 指定したインデックスにある要素取得または設定します
参照参照

関連項目

CollectionBase クラス
System.Collections 名前空間
ArrayList クラス
System.Collections.IList
ReadOnlyCollectionBase
System.Collections.Generic

その他の技術情報

カルチャを認識しい文字操作実行


このページでは「.NET Framework クラス ライブラリ リファレンス」からCollectionBaseを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCollectionBaseを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCollectionBase を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CollectionBase」の関連用語

CollectionBaseのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CollectionBaseのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS