Export (0) Print
Expand All

BitVector32.CreateSection Method (Int16)

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

Namespace:  System.Collections.Specialized
Assembly:  System (in System.dll)

static member CreateSection : 
        maxValue:int16 -> BitVector32.Section

Parameters

maxValue
Type: System.Int16

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

Return Value

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

ExceptionCondition
ArgumentException

maxValue is less than 1.

A BitVector32.Section is a window into the BitVector32 and is composed of the smallest number of consecutive bits that can contain the maximum value specified in CreateSection. 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 BitVector32.Section with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same BitVector32.

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

This method is an O(1) operation.

The following code example uses a BitVector32 as a collection of sections.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft