C# Class Lucene.Net.Util.FixedBitSet

BitSet of fixed length (numBits), backed by accessible (#getBits) long[], accessed with an int index, implementing GetBits and DocIdSet. If you need to manage more than 2.1B bits, use LongBitSet. @lucene.internal
Inheritance: DocIdSet, Bits
Datei anzeigen Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
And ( DocIdSetIterator iter ) : void

Does in-place AND of the bits provided by the iterator.

And ( FixedBitSet other ) : void

this = this AND other

AndNot ( DocIdSetIterator iter ) : void

Does in-place AND NOT of the bits provided by the iterator.

AndNot ( FixedBitSet other ) : void

this = this AND NOT other

AndNotCount ( FixedBitSet a, FixedBitSet b ) : long

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

Bits2words ( int numBits ) : int

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

Cardinality ( ) : int

Returns number of set bits. NOTE: this visits every long in the backing bits array, and the result is not internally cached!

Clear ( int index ) : void
Clear ( int startIndex, int endIndex ) : void

Clears a range of bits.

Clone ( ) : FixedBitSet
EnsureCapacity ( FixedBitSet bits, int numBits ) : FixedBitSet

If the given FixedBitSet is large enough to hold {@code numBits}, returns the given bits, otherwise returns a new FixedBitSet which can hold the requested number of bits.

NOTE: the returned bitset reuses the underlying {@code long[]} of the given {@code bits} if possible. Also, calling #length() on the returned bits may return a value greater than {@code numBits}.

Equals ( object o ) : bool

returns true if both sets have the same bits set

FixedBitSet ( int numBits ) : System
FixedBitSet ( long storedBits, int numBits ) : System
Flip ( int startIndex, int endIndex ) : void

Flips a range of bits

Get ( int index ) : bool
GetAndClear ( int index ) : bool
GetAndSet ( int index ) : bool
GetBits ( ) : Bits
GetHashCode ( ) : int
GetIterator ( ) : DocIdSetIterator
IntersectionCount ( FixedBitSet a, FixedBitSet b ) : long

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

Intersects ( FixedBitSet other ) : bool

returns true if the sets have any elements in common

Length ( ) : int
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.

Or ( DocIdSetIterator iter ) : void

Does in-place OR of the bits provided by the iterator.

Or ( FixedBitSet other ) : void

this = this OR other

PrevSetBit ( int index ) : int

Returns the index of the last set bit before or on the index specified. -1 is returned if there are no more set bits.

Set ( int index ) : void
Set ( int startIndex, int endIndex ) : void

Sets a range of bits

UnionCount ( FixedBitSet a, FixedBitSet b ) : long

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

Xor ( DocIdSetIterator iter ) : void

Does in-place XOR of the bits provided by the iterator.

Xor ( FixedBitSet other ) : void

this = this XOR other

Private Methods

Method Description
And ( long otherArr, int otherNumWords ) : void
AndNot ( long otherArr, int otherNumWords ) : void
Or ( long otherArr, int otherNumWords ) : void

Method Details

And() public method

Does in-place AND of the bits provided by the iterator.
public And ( DocIdSetIterator iter ) : void
iter DocIdSetIterator
return void

And() public method

this = this AND other
public And ( FixedBitSet other ) : void
other FixedBitSet
return void

AndNot() public method

Does in-place AND NOT of the bits provided by the iterator.
public AndNot ( DocIdSetIterator iter ) : void
iter DocIdSetIterator
return void

AndNot() public method

this = this AND NOT other
public AndNot ( FixedBitSet other ) : void
other FixedBitSet
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 ( FixedBitSet a, FixedBitSet b ) : long
a FixedBitSet
b FixedBitSet
return long

Bits2words() public static method

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

Cardinality() public method

Returns number of set bits. NOTE: this visits every long in the backing bits array, and the result is not internally cached!
public Cardinality ( ) : int
return int

Clear() public method

public Clear ( int index ) : void
index int
return void

Clear() public method

Clears a range of bits.
public Clear ( int startIndex, int endIndex ) : void
startIndex int lower index
endIndex int one-past the last bit to clear
return void

Clone() public method

public Clone ( ) : FixedBitSet
return FixedBitSet

EnsureCapacity() public static method

If the given FixedBitSet is large enough to hold {@code numBits}, returns the given bits, otherwise returns a new FixedBitSet which can hold the requested number of bits.

NOTE: the returned bitset reuses the underlying {@code long[]} of the given {@code bits} if possible. Also, calling #length() on the returned bits may return a value greater than {@code numBits}.

public static EnsureCapacity ( FixedBitSet bits, int numBits ) : FixedBitSet
bits FixedBitSet
numBits int
return FixedBitSet

Equals() public method

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

FixedBitSet() public method

public FixedBitSet ( int numBits ) : System
numBits int
return System

FixedBitSet() public method

public FixedBitSet ( long storedBits, int numBits ) : System
storedBits long
numBits int
return System

Flip() public method

Flips a range of bits
public Flip ( int startIndex, int endIndex ) : void
startIndex int lower index
endIndex int one-past the last bit to flip
return void

Get() public method

public Get ( int index ) : bool
index int
return bool

GetAndClear() public method

public GetAndClear ( int index ) : bool
index int
return bool

GetAndSet() public method

public GetAndSet ( int index ) : bool
index int
return bool

GetBits() public method

public GetBits ( ) : Bits
return Bits

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetIterator() public method

public GetIterator ( ) : DocIdSetIterator
return DocIdSetIterator

IntersectionCount() public static method

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

Intersects() public method

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

Length() public method

public Length ( ) : 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 ( int index ) : int
index int
return int

Or() public method

Does in-place OR of the bits provided by the iterator.
public Or ( DocIdSetIterator iter ) : void
iter DocIdSetIterator
return void

Or() public method

this = this OR other
public Or ( FixedBitSet other ) : void
other FixedBitSet
return void

PrevSetBit() public method

Returns the index of the last set bit before or on the index specified. -1 is returned if there are no more set bits.
public PrevSetBit ( int index ) : int
index int
return int

Set() public method

public Set ( int index ) : void
index int
return void

Set() public method

Sets a range of bits
public Set ( int startIndex, int endIndex ) : void
startIndex int lower index
endIndex int one-past the last bit to set
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 ( FixedBitSet a, FixedBitSet b ) : long
a FixedBitSet
b FixedBitSet
return long

Xor() public method

Does in-place XOR of the bits provided by the iterator.
public Xor ( DocIdSetIterator iter ) : void
iter DocIdSetIterator
return void

Xor() public method

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