BitArray.Length Propriedade

Definição

Obtém ou define o número de elementos no BitArray.Gets or sets the number of elements in the BitArray.

public:
 property int Length { int get(); void set(int value); };
public int Length { get; set; }
member this.Length : int with get, set
Public Property Length As Integer

Valor da propriedade

Int32

O número de elementos em BitArray.The number of elements in the BitArray.

Exceções

A propriedade foi definida como um valor menor que zero.The property is set to a value that is less than zero.

Comentários

Length e Count retornam o mesmo valor.Length and Count return the same value. Length pode ser definido como um valor específico, mas Count é somente leitura.Length can be set to a specific value, but Count is read-only.

Se Length é definido como um valor menor que Count , o BitArray é truncado e os elementos após o índice value -1 são excluídos.If Length is set to a value that is less than Count, the BitArray is truncated and the elements after the index value -1 are deleted.

Se Length é definido como um valor maior que Count , os novos elementos são definidos como false .If Length is set to a value that is greater than Count, the new elements are set to false.

A recuperação do valor dessa propriedade é uma O(1) operação.Retrieving the value of this property is an O(1) operation. A definição dessa propriedade é uma O(n) operação.Setting this property is an O(n) operation.

Aplica-se a