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
Afficher le fichier Open project: paulirwin/lucene.net Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
And ( long otherArr, int otherNumWords ) : void
AndNot ( long otherArr, int otherNumWords ) : void
Or ( long otherArr, int otherNumWords ) : void

Method Details

And() public méthode

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

And() public méthode

this = this AND other
public And ( FixedBitSet other ) : void
other FixedBitSet
Résultat void

AndNot() public méthode

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

AndNot() public méthode

this = this AND NOT other
public AndNot ( FixedBitSet other ) : void
other FixedBitSet
Résultat void

AndNotCount() public static méthode

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
Résultat long

Bits2words() public static méthode

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

Cardinality() public méthode

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
Résultat int

Clear() public méthode

public Clear ( int index ) : void
index int
Résultat void

Clear() public méthode

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
Résultat void

Clone() public méthode

public Clone ( ) : FixedBitSet
Résultat FixedBitSet

EnsureCapacity() public static méthode

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
Résultat FixedBitSet

Equals() public méthode

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

FixedBitSet() public méthode

public FixedBitSet ( int numBits ) : System
numBits int
Résultat System

FixedBitSet() public méthode

public FixedBitSet ( long storedBits, int numBits ) : System
storedBits long
numBits int
Résultat System

Flip() public méthode

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
Résultat void

Get() public méthode

public Get ( int index ) : bool
index int
Résultat bool

GetAndClear() public méthode

public GetAndClear ( int index ) : bool
index int
Résultat bool

GetAndSet() public méthode

public GetAndSet ( int index ) : bool
index int
Résultat bool

GetBits() public méthode

public GetBits ( ) : Bits
Résultat Bits

GetHashCode() public méthode

public GetHashCode ( ) : int
Résultat int

GetIterator() public méthode

public GetIterator ( ) : DocIdSetIterator
Résultat DocIdSetIterator

IntersectionCount() public static méthode

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
Résultat long

Intersects() public méthode

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

Length() public méthode

public Length ( ) : int
Résultat int

NextSetBit() public méthode

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
Résultat int

Or() public méthode

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

Or() public méthode

this = this OR other
public Or ( FixedBitSet other ) : void
other FixedBitSet
Résultat void

PrevSetBit() public méthode

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
Résultat int

Set() public méthode

public Set ( int index ) : void
index int
Résultat void

Set() public méthode

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
Résultat void

UnionCount() public static méthode

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
Résultat long

Xor() public méthode

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

Xor() public méthode

this = this XOR other
public Xor ( FixedBitSet other ) : void
other FixedBitSet
Résultat void