C# Class Lucene.Net.Util.OpenBitSet

Inheritance: Lucene.Net.Search.DocIdSet, System.ICloneable
显示文件 Open project: synhershko/lucene.net Class Usage Examples

Protected Properties

Property Type Description
internalbits long[]
wlen int

Private Properties

Property Type Description

Public Methods

Method Description
And ( OpenBitSet other ) : void
AndNot ( OpenBitSet other ) : void
AndNotCount ( OpenBitSet a, OpenBitSet b ) : long

Returns the popcount or cardinality of "a and not b" or "intersection(a, not(b))". Neither set is modified.

Bits2words ( long numBits ) : int

returns the number of 64 bit words it would take to hold numBits

Capacity ( ) : long

Returns the current capacity in bits (1 greater than the index of the last bit)

Cardinality ( ) : long
Clear ( int startIndex, int endIndex ) : void

Clears a range of bits. Clearing past the end does not change the size of the set.

Clear ( long index ) : void

clears a bit, allowing access beyond the current set size without changing the size.

Clear ( long startIndex, long endIndex ) : void

Clears a range of bits. Clearing past the end does not change the size of the set.

Clone ( ) : Object
EnsureCapacity ( long numBits ) : void

Ensure that the long[] is big enough to hold numBits, expanding it if necessary. getNumWords() is unchanged by this call.

EnsureCapacityWords ( int numWords ) : void

Expand the long[] with the size given as a number of words (64 bit longs). getNumWords() is unchanged by this call.

Equals ( System o ) : bool

returns true if both sets have the same bits set

FastClear ( int index ) : void

clears a bit. The index should be less than the OpenBitSet size.

FastClear ( long index ) : void

clears a bit. The index should be less than the OpenBitSet size.

FastFlip ( int index ) : void

flips a bit. The index should be less than the OpenBitSet size.

FastFlip ( long index ) : void

flips a bit. The index should be less than the OpenBitSet size.

FastGet ( int index ) : bool

Returns true or false for the specified bit index. The index should be less than the OpenBitSet size

FastGet ( long index ) : bool

Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.

FastSet ( int index ) : void

Sets the bit at the specified index. The index should be less than the OpenBitSet size.

FastSet ( long index ) : void

Sets the bit at the specified index. The index should be less than the OpenBitSet size.

Flip ( long index ) : void

flips a bit, expanding the set size if necessary

Flip ( long startIndex, long endIndex ) : void

Flips a range of bits, expanding the set size if necessary

FlipAndGet ( int index ) : bool

flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.

FlipAndGet ( long index ) : bool

flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.

Get ( int index ) : bool

Returns true or false for the specified bit index.

Get ( long index ) : bool

Returns true or false for the specified bit index

GetAndSet ( int index ) : bool

Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.

GetAndSet ( long index ) : bool

Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.

GetBit ( int index ) : int

returns 1 if the bit is set, 0 if not. The index should be less than the OpenBitSet size

GetHashCode ( ) : int
Intersect ( OpenBitSet other ) : void

this = this AND other

IntersectionCount ( OpenBitSet a, OpenBitSet b ) : long

Returns the popcount or cardinality of the intersection of the two sets. Neither set is modified.

Intersects ( OpenBitSet other ) : bool

returns true if the sets have any elements in common

IsEmpty ( ) : bool

Returns true if there are no set bits

Iterator ( ) : Lucene.Net.Search.DocIdSetIterator
NextSetBit ( int index ) : int

Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.

NextSetBit ( long index ) : long

Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.

OpenBitSet ( ) : System
OpenBitSet ( long numBits ) : System

Constructs an OpenBitSet large enough to hold numBits.

OpenBitSet ( long bits, int numWords ) : System

Constructs an OpenBitSet from an existing long[].
The first 64 bits are in long[0], with bit index 0 at the least significant bit, and bit index 63 at the most significant. Given a bit index, the word containing it is long[index/64], and it is at bit number index%64 within that word.

numWords are the number of elements in the array that contain set bits (non-zero longs). numWords should be <= bits.length, and any existing words in the array at position >= numWords should be zero.

Or ( OpenBitSet other ) : void
Remove ( OpenBitSet other ) : void

Remove all elements set in other. this = this AND_NOT other

Set ( long index ) : void

sets a bit, expanding the set size if necessary

Set ( long startIndex, long endIndex ) : void

Sets a range of bits, expanding the set size if necessary

Size ( ) : long

Returns the current capacity of this set. Included for compatibility. This is *not* equal to Cardinality

TrimTrailingZeros ( ) : void

Lowers numWords, the number of words in use, by checking for trailing zero words.

Union ( OpenBitSet other ) : void

this = this OR other

UnionCount ( OpenBitSet a, OpenBitSet b ) : long

Returns the popcount or cardinality of the union of the two sets. Neither set is modified.

Xor ( OpenBitSet other ) : void

this = this XOR other

XorCount ( OpenBitSet a, OpenBitSet b ) : long

Returns the popcount or cardinality of the exclusive-or of the two sets. Neither set is modified.

Protected Methods

Method Description
ExpandingWordNum ( long index ) : int

Method Details

And() public method

public And ( OpenBitSet other ) : void
other OpenBitSet
return void

AndNot() public method

public AndNot ( OpenBitSet other ) : void
other OpenBitSet
return void

AndNotCount() public static method

Returns the popcount or cardinality of "a and not b" or "intersection(a, not(b))". Neither set is modified.
public static AndNotCount ( OpenBitSet a, OpenBitSet b ) : long
a OpenBitSet
b OpenBitSet
return long

Bits2words() public static method

returns the number of 64 bit words it would take to hold numBits
public static Bits2words ( long numBits ) : int
numBits long
return int

Capacity() public method

Returns the current capacity in bits (1 greater than the index of the last bit)
public Capacity ( ) : long
return long

Cardinality() public method

public Cardinality ( ) : long
return long

Clear() public method

Clears a range of bits. Clearing past the end does not change the size of the set.
public Clear ( int startIndex, int endIndex ) : void
startIndex int lower index ///
endIndex int one-past the last bit to clear ///
return void

Clear() public method

clears a bit, allowing access beyond the current set size without changing the size.
public Clear ( long index ) : void
index long
return void

Clear() public method

Clears a range of bits. Clearing past the end does not change the size of the set.
public Clear ( long startIndex, long endIndex ) : void
startIndex long lower index ///
endIndex long one-past the last bit to clear ///
return void

Clone() public method

public Clone ( ) : Object
return System.Object

EnsureCapacity() public method

Ensure that the long[] is big enough to hold numBits, expanding it if necessary. getNumWords() is unchanged by this call.
public EnsureCapacity ( long numBits ) : void
numBits long
return void

EnsureCapacityWords() public method

Expand the long[] with the size given as a number of words (64 bit longs). getNumWords() is unchanged by this call.
public EnsureCapacityWords ( int numWords ) : void
numWords int
return void

Equals() public method

returns true if both sets have the same bits set
public Equals ( System o ) : bool
o System
return bool

ExpandingWordNum() protected method

protected ExpandingWordNum ( long index ) : int
index long
return int

FastClear() public method

clears a bit. The index should be less than the OpenBitSet size.
public FastClear ( int index ) : void
index int
return void

FastClear() public method

clears a bit. The index should be less than the OpenBitSet size.
public FastClear ( long index ) : void
index long
return void

FastFlip() public method

flips a bit. The index should be less than the OpenBitSet size.
public FastFlip ( int index ) : void
index int
return void

FastFlip() public method

flips a bit. The index should be less than the OpenBitSet size.
public FastFlip ( long index ) : void
index long
return void

FastGet() public method

Returns true or false for the specified bit index. The index should be less than the OpenBitSet size
public FastGet ( int index ) : bool
index int
return bool

FastGet() public method

Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.
public FastGet ( long index ) : bool
index long
return bool

FastSet() public method

Sets the bit at the specified index. The index should be less than the OpenBitSet size.
public FastSet ( int index ) : void
index int
return void

FastSet() public method

Sets the bit at the specified index. The index should be less than the OpenBitSet size.
public FastSet ( long index ) : void
index long
return void

Flip() public method

flips a bit, expanding the set size if necessary
public Flip ( long index ) : void
index long
return void

Flip() public method

Flips a range of bits, expanding the set size if necessary
public Flip ( long startIndex, long endIndex ) : void
startIndex long lower index ///
endIndex long one-past the last bit to flip ///
return void

FlipAndGet() public method

flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
public FlipAndGet ( int index ) : bool
index int
return bool

FlipAndGet() public method

flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
public FlipAndGet ( long index ) : bool
index long
return bool

Get() public method

Returns true or false for the specified bit index.
public Get ( int index ) : bool
index int
return bool

Get() public method

Returns true or false for the specified bit index
public Get ( long index ) : bool
index long
return bool

GetAndSet() public method

Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
public GetAndSet ( int index ) : bool
index int
return bool

GetAndSet() public method

Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
public GetAndSet ( long index ) : bool
index long
return bool

GetBit() public method

returns 1 if the bit is set, 0 if not. The index should be less than the OpenBitSet size
public GetBit ( int index ) : int
index int
return int

GetHashCode() public method

public GetHashCode ( ) : int
return int

Intersect() public method

this = this AND other
public Intersect ( OpenBitSet other ) : void
other OpenBitSet
return void

IntersectionCount() public static method

Returns the popcount or cardinality of the intersection of the two sets. Neither set is modified.
public static IntersectionCount ( OpenBitSet a, OpenBitSet b ) : long
a OpenBitSet
b OpenBitSet
return long

Intersects() public method

returns true if the sets have any elements in common
public Intersects ( OpenBitSet other ) : bool
other OpenBitSet
return bool

IsEmpty() public method

Returns true if there are no set bits
public IsEmpty ( ) : bool
return bool

Iterator() public method

public Iterator ( ) : Lucene.Net.Search.DocIdSetIterator
return Lucene.Net.Search.DocIdSetIterator

NextSetBit() public method

Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
public NextSetBit ( int index ) : int
index int
return int

NextSetBit() public method

Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
public NextSetBit ( long index ) : long
index long
return long

OpenBitSet() public method

public OpenBitSet ( ) : System
return System

OpenBitSet() public method

Constructs an OpenBitSet large enough to hold numBits.
public OpenBitSet ( long numBits ) : System
numBits long ///
return System

OpenBitSet() public method

Constructs an OpenBitSet from an existing long[].
The first 64 bits are in long[0], with bit index 0 at the least significant bit, and bit index 63 at the most significant. Given a bit index, the word containing it is long[index/64], and it is at bit number index%64 within that word.

numWords are the number of elements in the array that contain set bits (non-zero longs). numWords should be <= bits.length, and any existing words in the array at position >= numWords should be zero.

public OpenBitSet ( long bits, int numWords ) : System
bits long
numWords int
return System

Or() public method

public Or ( OpenBitSet other ) : void
other OpenBitSet
return void

Remove() public method

Remove all elements set in other. this = this AND_NOT other
public Remove ( OpenBitSet other ) : void
other OpenBitSet
return void

Set() public method

sets a bit, expanding the set size if necessary
public Set ( long index ) : void
index long
return void

Set() public method

Sets a range of bits, expanding the set size if necessary
public Set ( long startIndex, long endIndex ) : void
startIndex long lower index ///
endIndex long one-past the last bit to set ///
return void

Size() public method

Returns the current capacity of this set. Included for compatibility. This is *not* equal to Cardinality
public Size ( ) : long
return long

TrimTrailingZeros() public method

Lowers numWords, the number of words in use, by checking for trailing zero words.
public TrimTrailingZeros ( ) : void
return void

Union() public method

this = this OR other
public Union ( OpenBitSet other ) : void
other OpenBitSet
return void

UnionCount() public static method

Returns the popcount or cardinality of the union of the two sets. Neither set is modified.
public static UnionCount ( OpenBitSet a, OpenBitSet b ) : long
a OpenBitSet
b OpenBitSet
return long

Xor() public method

this = this XOR other
public Xor ( OpenBitSet other ) : void
other OpenBitSet
return void

XorCount() public static method

Returns the popcount or cardinality of the exclusive-or of the two sets. Neither set is modified.
public static XorCount ( OpenBitSet a, OpenBitSet b ) : long
a OpenBitSet
b OpenBitSet
return long

Property Details

internalbits protected_oe property

protected long[] internalbits
return long[]

wlen protected_oe property

protected int wlen
return int