BitVector32.Section プロパティ
BitVector32.Section メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの BitVector32.Section オブジェクトが同じかどうかを判断します。 |
![]() | GetHashCode | オーバーライドされます。 現在の BitVector32.Section のハッシュ関数として機能します。ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | op_Equality | 指定した 2 つの BitVector32.Section オブジェクトが等しいかどうかを判断します。 |
![]() | op_Inequality | 2 つの BitVector32.Section オブジェクトの値が異なるかどうかを判断します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーロードされます。 オーバーライドされます。 現在の BitVector32.Section を表す文字列を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

BitVector32.Section メンバ
BitVector32.Section データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの BitVector32.Section オブジェクトが同じかどうかを判断します。 |
![]() | GetHashCode | オーバーライドされます。 現在の BitVector32.Section のハッシュ関数として機能します。ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | op_Equality | 指定した 2 つの BitVector32.Section オブジェクトが等しいかどうかを判断します。 |
![]() | op_Inequality | 2 つの BitVector32.Section オブジェクトの値が異なるかどうかを判断します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーロードされます。 オーバーライドされます。 現在の BitVector32.Section を表す文字列を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

BitVector32.Section 構造体
アセンブリ: System (system.dll 内)


CreateSection を使用して新しいセクションを定義します。BitVector32.Section は BitVector32 内のウィンドウで、CreateSection で指定した最大値を格納できる最小数の連続ビットから構成されます。たとえば、最大値が 1 のセクションは 1 ビットだけで構成され、最大値が 5 のセクションは 3 ビットで構成されます。ブール値として機能する最大値 1 で BitVector32.Section を作成して、同じ BitVector32 に整数とブール値を格納できます。

次のコード例では、BitVector32 をセクションのコレクションとして使用しています。
Imports System Imports System.Collections.Specialized Public Class SamplesBitVector32 Public Shared Sub Main() ' Creates and initializes a BitVector32. Dim myBV As New BitVector32(0) ' Creates four sections in the BitVector32 with maximum values 6, 3, 1, and 15. ' mySect3, which uses exactly one bit, can also be used as a bit flag. Dim mySect1 As BitVector32.Section = BitVector32.CreateSection(6) Dim mySect2 As BitVector32.Section = BitVector32.CreateSection(3, mySect1) Dim mySect3 As BitVector32.Section = BitVector32.CreateSection(1, mySect2) Dim mySect4 As BitVector32.Section = BitVector32.CreateSection(15, mySect3) ' Displays the values of the sections. Console.WriteLine("Initial values:") Console.WriteLine(ControlChars.Tab + "mySect1: {0}", myBV(mySect1)) Console.WriteLine(ControlChars.Tab + "mySect2: {0}", myBV(mySect2)) Console.WriteLine(ControlChars.Tab + "mySect3: {0}", myBV(mySect3)) Console.WriteLine(ControlChars.Tab + "mySect4: {0}", myBV(mySect4)) ' Sets each section to a new value and displays the value of the BitVector32 at each step. Console.WriteLine("Changing the values of each section:") Console.WriteLine(ControlChars.Tab + "Initial: " + ControlChars.Tab + "{0}", myBV.ToString()) myBV(mySect1) = 5 Console.WriteLine(ControlChars.Tab + "mySect1 = 5:" + ControlChars.Tab + "{0}", myBV.ToString()) myBV(mySect2) = 3 Console.WriteLine(ControlChars.Tab + "mySect2 = 3:" + ControlChars.Tab + "{0}", myBV.ToString()) myBV(mySect3) = 1 Console.WriteLine(ControlChars.Tab + "mySect3 = 1:" + ControlChars.Tab + "{0}", myBV.ToString()) myBV(mySect4) = 9 Console.WriteLine(ControlChars.Tab + "mySect4 = 9:" + ControlChars.Tab + "{0}", myBV.ToString()) ' Displays the values of the sections. Console.WriteLine("New values:") Console.WriteLine(ControlChars.Tab + "mySect1: {0}", myBV(mySect1)) Console.WriteLine(ControlChars.Tab + "mySect2: {0}", myBV(mySect2)) Console.WriteLine(ControlChars.Tab + "mySect3: {0}", myBV(mySect3)) Console.WriteLine(ControlChars.Tab + "mySect4: {0}", myBV(mySect4)) End Sub 'Main End Class 'SamplesBitVector32 ' This code produces the following output. ' ' Initial values: ' mySect1: 0 ' mySect2: 0 ' mySect3: 0 ' mySect4: 0 ' Changing the values of each section: ' Initial: BitVector32{00000000000000000000000000000000} ' mySect1 = 5: BitVector32{00000000000000000000000000000101} ' mySect2 = 3: BitVector32{00000000000000000000000000011101} ' mySect3 = 1: BitVector32{00000000000000000000000000111101} ' mySect4 = 9: BitVector32{00000000000000000000001001111101} ' New values: ' mySect1: 5 ' mySect2: 3 ' mySect3: 1 ' mySect4: 9
using System; using System.Collections.Specialized; public class SamplesBitVector32 { public static void Main() { // Creates and initializes a BitVector32. BitVector32 myBV = new BitVector32( 0 ); // Creates four sections in the BitVector32 with maximum values 6, 3, 1, and 15. // mySect3, which uses exactly one bit, can also be used as a bit flag. BitVector32.Section mySect1 = BitVector32.CreateSection( 6 ); BitVector32.Section mySect2 = BitVector32.CreateSection( 3, mySect1 ); BitVector32.Section mySect3 = BitVector32.CreateSection( 1, mySect2 ); BitVector32.Section mySect4 = BitVector32.CreateSection( 15, mySect3 ); // Displays the values of the sections. Console.WriteLine( "Initial values:" ); Console.WriteLine( "\tmySect1: {0}", myBV[mySect1] ); Console.WriteLine( "\tmySect2: {0}", myBV[mySect2] ); Console.WriteLine( "\tmySect3: {0}", myBV[mySect3] ); Console.WriteLine( "\tmySect4: {0}", myBV[mySect4] ); // Sets each section to a new value and displays the value of the BitVector32 at each step. Console.WriteLine( "Changing the values of each section:" ); Console.WriteLine( "\tInitial: \t{0}", myBV.ToString() ); myBV[mySect1] = 5; Console.WriteLine( "\tmySect1 = 5:\t{0}", myBV.ToString() ); myBV[mySect2] = 3; Console.WriteLine( "\tmySect2 = 3:\t{0}", myBV.ToString() ); myBV[mySect3] = 1; Console.WriteLine( "\tmySect3 = 1:\t{0}", myBV.ToString() ); myBV[mySect4] = 9; Console.WriteLine( "\tmySect4 = 9:\t{0}", myBV.ToString() ); // Displays the values of the sections. Console.WriteLine( "New values:" ); Console.WriteLine( "\tmySect1: {0}", myBV[mySect1] ); Console.WriteLine( "\tmySect2: {0}", myBV[mySect2] ); Console.WriteLine( "\tmySect3: {0}", myBV[mySect3] ); Console.WriteLine( "\tmySect4: {0}", myBV[mySect4] ); } } /* This code produces the following output. Initial values: mySect1: 0 mySect2: 0 mySect3: 0 mySect4: 0 Changing the values of each section: Initial: BitVector32{00000000000000000000000000000000} mySect1 = 5: BitVector32{00000000000000000000000000000101} mySect2 = 3: BitVector32{00000000000000000000000000011101} mySect3 = 1: BitVector32{00000000000000000000000000111101} mySect4 = 9: BitVector32{00000000000000000000001001111101} New values: mySect1: 5 mySect2: 3 mySect3: 1 mySect4: 9 */
#using <system.dll> using namespace System; using namespace System::Collections::Specialized; int main() { // Creates and initializes a BitVector32. BitVector32 myBV(0); // Creates four sections in the BitVector32 with maximum values 6, 3, 1, and 15. // mySect3, which uses exactly one bit, can also be used as a bit flag. BitVector32::Section mySect1 = BitVector32::CreateSection( 6 ); BitVector32::Section mySect2 = BitVector32::CreateSection( 3, mySect1 ); BitVector32::Section mySect3 = BitVector32::CreateSection( 1, mySect2 ); BitVector32::Section mySect4 = BitVector32::CreateSection( 15, mySect3 ); // Displays the values of the sections. Console::WriteLine( "Initial values:" ); Console::WriteLine( "\tmySect1: {0}", myBV[ mySect1 ] ); Console::WriteLine( "\tmySect2: {0}", myBV[ mySect2 ] ); Console::WriteLine( "\tmySect3: {0}", myBV[ mySect3 ] ); Console::WriteLine( "\tmySect4: {0}", myBV[ mySect4 ] ); // Sets each section to a new value and displays the value of the BitVector32 at each step. Console::WriteLine( "Changing the values of each section:" ); Console::WriteLine( "\tInitial: \t {0}", myBV ); myBV[ mySect1 ] = 5; Console::WriteLine( "\tmySect1 = 5:\t {0}", myBV ); myBV[ mySect2 ] = 3; Console::WriteLine( "\tmySect2 = 3:\t {0}", myBV ); myBV[ mySect3 ] = 1; Console::WriteLine( "\tmySect3 = 1:\t {0}", myBV ); myBV[ mySect4 ] = 9; Console::WriteLine( "\tmySect4 = 9:\t {0}", myBV ); // Displays the values of the sections. Console::WriteLine( "New values:" ); Console::WriteLine( "\tmySect1: {0}", myBV[ mySect1 ] ); Console::WriteLine( "\tmySect2: {0}", myBV[ mySect2 ] ); Console::WriteLine( "\tmySect3: {0}", myBV[ mySect3 ] ); Console::WriteLine( "\tmySect4: {0}", myBV[ mySect4 ] ); } /* This code produces the following output. Initial values: mySect1: 0 mySect2: 0 mySect3: 0 mySect4: 0 Changing the values of each section: Initial: BitVector32 {00000000000000000000000000000000} mySect1 = 5: BitVector32 {00000000000000000000000000000101} mySect2 = 3: BitVector32 {00000000000000000000000000011101} mySect3 = 1: BitVector32 {00000000000000000000000000111101} mySect4 = 9: BitVector32 {00000000000000000000001001111101} New values: mySect1: 5 mySect2: 3 mySect3: 1 mySect4: 9 */
import System.*; import System.Collections.Specialized.*; public class SamplesBitVector32 { public static void main(String[] args) { // Creates and initializes a BitVector32. BitVector32 myBV = new BitVector32(0); // Creates four sections in the BitVector32 with maximum values // 6, 3, 1, and 15. mySect3, which uses exactly one bit, // can also be used as a bit flag. BitVector32.Section mySect1 = BitVector32.CreateSection((short)6); BitVector32.Section mySect2 = BitVector32.CreateSection((short)3, mySect1); BitVector32.Section mySect3 = BitVector32.CreateSection((short)1, mySect2); BitVector32.Section mySect4 = BitVector32.CreateSection((short)15, mySect3); // Displays the values of the sections. Console.WriteLine("Initial values:"); Console.WriteLine("\tmySect1: {0}", System.Convert.ToString(myBV .get_Item( mySect1))); Console.WriteLine("\tmySect2: {0}", System.Convert.ToString(myBV.get_Item( mySect2))); Console.WriteLine("\tmySect3: {0}", System.Convert.ToString(myBV.get_Item(mySect3))); Console.WriteLine("\tmySect4: {0}", System.Convert.ToString(myBV.get_Item(mySect4))); // Sets each section to a new value and displays the value of the // BitVector32 at each step. Console.WriteLine("Changing the values of each section:"); Console.WriteLine("\tInitial: \t{0}", myBV.ToString()); myBV.set_Item(mySect1 , 5); Console.WriteLine("\tmySect1 = 5:\t{0}", myBV.ToString()); myBV.set_Item(mySect2 , 3); Console.WriteLine("\tmySect2 = 3:\t{0}", myBV.ToString()); myBV.set_Item(mySect3 , 1); Console.WriteLine("\tmySect3 = 1:\t{0}", myBV.ToString()); myBV.set_Item(mySect4 , 9); Console.WriteLine("\tmySect4 = 9:\t{0}", myBV.ToString()); // Displays the values of the sections. Console.WriteLine("New values:"); Console.WriteLine("\tmySect1: {0}", System.Convert.ToString(myBV.get_Item( mySect1))); Console.WriteLine("\tmySect2: {0}", System.Convert.ToString(myBV.get_Item(mySect2))); Console.WriteLine("\tmySect3: {0}", System.Convert.ToString(myBV.get_Item(mySect3))); Console.WriteLine("\tmySect4: {0}", System.Convert.ToString(myBV.get_Item(mySect4))); } //main } //SamplesBitVector32 /* This code produces the following output. Initial values: mySect1: 0 mySect2: 0 mySect3: 0 mySect4: 0 Changing the values of each section: Initial: BitVector32{00000000000000000000000000000000} mySect1 = 5: BitVector32{00000000000000000000000000000101} mySect2 = 3: BitVector32{00000000000000000000000000011101} mySect3 = 1: BitVector32{00000000000000000000000000111101} mySect4 = 9: BitVector32{00000000000000000000001001111101} New values: mySect1: 5 mySect2: 3 mySect3: 1 mySect4: 9 */


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- BitVector32.Sectionのページへのリンク