System.Collections.Specialized.BitVector32.CreateSection Method

Creates the first System.Collections.Specialized.BitVector32.Section in a series of sections that contain small integers.

Syntax

public static BitVector32.Section CreateSection (short maxValue)

Parameters

maxValue
A 16-bit signed integer that specifies the maximum value for the new System.Collections.Specialized.BitVector32.Section.

Returns

A System.Collections.Specialized.BitVector32.Section that can hold a number from zero to maxValue.

Remarks

A System.Collections.Specialized.BitVector32.Section is a window into the System.Collections.Specialized.BitVector32 and is composed of the smallest number of consecutive bits that can contain the maximum value specified in BitVector32.CreateSection(short). For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a System.Collections.Specialized.BitVector32.Section with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same System.Collections.Specialized.BitVector32.

If sections already exist in the System.Collections.Specialized.BitVector32, those sections are still accessible; however, overlapping sections might cause unexpected results.

This method is an O(1) operation.

Requirements

Namespace: System.Collections.Specialized
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0