C# Класс BitsetsNET.ArrayContainer

Наследование: Container
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Cardinality int
Content ushort[]

Открытые методы

Метод Описание
Add ( ushort x ) : Container

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.

Add ( ushort rangeStart, ushort rangeEnd ) : Container

Add to the current bitmap all integers in [rangeStart,rangeEnd).

And ( ArrayContainer value2 ) : Container

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.

And ( BitsetContainer x ) : Container

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.

AndNot ( ArrayContainer x ) : Container

Returns the elements of this ArrayContainer that are not in the other ArrayContainer.

AndNot ( BitsetContainer x ) : Container

Returns the elements of this ArrayContainer that are not in the other BitSetContainer.

ArrayContainer ( ) : System
ArrayContainer ( int capacity ) : System
ArrayContainer ( ushort newContent ) : System
Clone ( ) : Container

Creates a deep copy of this array container.

Contains ( ushort x ) : bool

Checks whether the container contains the provided value.

Deserialize ( BinaryReader reader, int cardinality ) : ArrayContainer

Deserialize a container from binary format, as written by the Serialize method, minus the first 32 bits giving the cardinality.

Equals ( Object o ) : bool
FillLeastSignificant16bits ( int x, int i, int mask ) : void

Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.

Flip ( ushort x ) : Container

If elements is present in container, add it. Otherwise, remove it.

GetCardinality ( ) : int

Computes the distinct number of short values in the container. Can be expected to run in constant time.

GetEnumerator ( ) : IEnumerator
GetHashCode ( ) : int
IAdd ( ushort begin, ushort end ) : Container

Adds range of elements (in-place) to this container.

IAnd ( ArrayContainer other ) : Container

Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.

IAnd ( BitsetContainer other ) : Container

Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.

IAndNot ( ArrayContainer x ) : Container

Returns the elements of this ArrayContainer that are not in the other ArrayContainer.

IAndNot ( BitsetContainer x ) : Container

Returns the elements of this ArrayContainer that are not in the other BitSetContainer. Modifies the current container in place.

INot ( int firstOfRange, int lastOfRange ) : Container

Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected.The current container is generally modified.May generate a new container.

IOr ( ArrayContainer x ) : Container

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.

IOr ( BitsetContainer x ) : Container

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.

IncreaseCapacity ( ) : void
Intersects ( ArrayContainer x ) : bool

Returns true if the current container intersects the other container.

Intersects ( BitsetContainer x ) : bool

Returns true if the current container intersects the other container.

LoadData ( BitsetContainer bitsetContainer ) : void
Or ( ArrayContainer x ) : Container

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.

Or ( BitsetContainer x ) : Container

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.

Remove ( ushort x ) : Container

Remove specified short from this container. May create a new container.

Remove ( ushort begin, ushort end ) : Container

Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.

Select ( int j ) : ushort

Return the jth value of the container.

Serialize ( BinaryWriter writer ) : void

Serialize this container in a binary format.

The serialization format is first the cardinality of the container as a 32-bit integer, followed by an array of the indices in this container as 16-bit integers.

ToBitsetContainer ( ) : BitsetContainer

Приватные методы

Метод Описание
ArrayContainer ( int cardinality, ushort inpContent ) : System
IncreaseCapacity ( int min ) : void
NegateRange ( ushort buffer, int startIndex, int lastIndex, int startRange, int lastRange ) : void

Описание методов

Add() публичный Метод

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
public Add ( ushort x ) : Container
x ushort Other container
Результат Container

Add() публичный Метод

Add to the current bitmap all integers in [rangeStart,rangeEnd).
public Add ( ushort rangeStart, ushort rangeEnd ) : Container
rangeStart ushort inclusive beginning of range
rangeEnd ushort exclusive ending of range
Результат Container

And() публичный Метод

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
public And ( ArrayContainer value2 ) : Container
value2 ArrayContainer
Результат Container

And() публичный Метод

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
public And ( BitsetContainer x ) : Container
x BitsetContainer Other container
Результат Container

AndNot() публичный Метод

Returns the elements of this ArrayContainer that are not in the other ArrayContainer.
public AndNot ( ArrayContainer x ) : Container
x ArrayContainer the other ArrayContainer
Результат Container

AndNot() публичный Метод

Returns the elements of this ArrayContainer that are not in the other BitSetContainer.
public AndNot ( BitsetContainer x ) : Container
x BitsetContainer the BitSetContainer to compare against
Результат Container

ArrayContainer() публичный Метод

public ArrayContainer ( ) : System
Результат System

ArrayContainer() публичный Метод

public ArrayContainer ( int capacity ) : System
capacity int
Результат System

ArrayContainer() публичный Метод

public ArrayContainer ( ushort newContent ) : System
newContent ushort
Результат System

Clone() публичный Метод

Creates a deep copy of this array container.
public Clone ( ) : Container
Результат Container

Contains() публичный Метод

Checks whether the container contains the provided value.
public Contains ( ushort x ) : bool
x ushort Value to check
Результат bool

Deserialize() публичный статический Метод

Deserialize a container from binary format, as written by the Serialize method, minus the first 32 bits giving the cardinality.
public static Deserialize ( BinaryReader reader, int cardinality ) : ArrayContainer
reader System.IO.BinaryReader The reader to deserialize from.
cardinality int
Результат ArrayContainer

Equals() публичный Метод

public Equals ( Object o ) : bool
o Object
Результат bool

FillLeastSignificant16bits() публичный Метод

Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.
public FillLeastSignificant16bits ( int x, int i, int mask ) : void
x int Provided array
i int Starting index
mask int Indicates most significant bits
Результат void

Flip() публичный Метод

If elements is present in container, add it. Otherwise, remove it.
public Flip ( ushort x ) : Container
x ushort Element to add
Результат Container

GetCardinality() публичный Метод

Computes the distinct number of short values in the container. Can be expected to run in constant time.
public GetCardinality ( ) : int
Результат int

GetEnumerator() публичный Метод

public GetEnumerator ( ) : IEnumerator
Результат IEnumerator

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

IAdd() публичный Метод

Adds range of elements (in-place) to this container.
public IAdd ( ushort begin, ushort end ) : Container
begin ushort Start of range (inclusive)
end ushort End of range (exclusive)
Результат Container

IAnd() публичный Метод

Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
public IAnd ( ArrayContainer other ) : Container
other ArrayContainer
Результат Container

IAnd() публичный Метод

Computes the in-place bitwise AND of this container with another (intersection). The current container is generally modified, whereas the provided container (x) is unaffected. May generate a new container.
public IAnd ( BitsetContainer other ) : Container
other BitsetContainer
Результат Container

IAndNot() публичный Метод

Returns the elements of this ArrayContainer that are not in the other ArrayContainer.
public IAndNot ( ArrayContainer x ) : Container
x ArrayContainer the other ArrayContainer
Результат Container

IAndNot() публичный Метод

Returns the elements of this ArrayContainer that are not in the other BitSetContainer. Modifies the current container in place.
public IAndNot ( BitsetContainer x ) : Container
x BitsetContainer the BitSetContainer to compare against
Результат Container

INot() публичный Метод

Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected.The current container is generally modified.May generate a new container.
public INot ( int firstOfRange, int lastOfRange ) : Container
firstOfRange int beginning of range (inclusive); 0 is beginning of this container.
lastOfRange int ending of range (exclusive)
Результат Container

IOr() публичный Метод

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.
public IOr ( ArrayContainer x ) : Container
x ArrayContainer Other container
Результат Container

IOr() публичный Метод

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.
public IOr ( BitsetContainer x ) : Container
x BitsetContainer Other container
Результат Container

IncreaseCapacity() публичный Метод

public IncreaseCapacity ( ) : void
Результат void

Intersects() публичный Метод

Returns true if the current container intersects the other container.
public Intersects ( ArrayContainer x ) : bool
x ArrayContainer Other container
Результат bool

Intersects() публичный Метод

Returns true if the current container intersects the other container.
public Intersects ( BitsetContainer x ) : bool
x BitsetContainer Other container
Результат bool

LoadData() публичный Метод

public LoadData ( BitsetContainer bitsetContainer ) : void
bitsetContainer BitsetContainer
Результат void

Or() публичный Метод

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
public Or ( ArrayContainer x ) : Container
x ArrayContainer Other container
Результат Container

Or() публичный Метод

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
public Or ( BitsetContainer x ) : Container
x BitsetContainer Other container
Результат Container

Remove() публичный Метод

Remove specified short from this container. May create a new container.
public Remove ( ushort x ) : Container
x ushort Short to be removed
Результат Container

Remove() публичный Метод

Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.
public Remove ( ushort begin, ushort end ) : Container
begin ushort Start of range (inclusive)
end ushort End of range (exclusive)
Результат Container

Select() публичный Метод

Return the jth value of the container.
public Select ( int j ) : ushort
j int Index of the value
Результат ushort

Serialize() публичный Метод

Serialize this container in a binary format.
The serialization format is first the cardinality of the container as a 32-bit integer, followed by an array of the indices in this container as 16-bit integers.
public Serialize ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter The writer to which to serialize this container.
Результат void

ToBitsetContainer() публичный Метод

public ToBitsetContainer ( ) : BitsetContainer
Результат BitsetContainer

Описание свойств

Cardinality публичное свойство

public int Cardinality
Результат int

Content публичное свойство

public ushort[] Content
Результат ushort[]