The OpenBitSet type exposes the following members.

Constructors

  NameDescription
Public methodOpenBitSet()()()()
Initializes a new instance of the OpenBitSet class
Public methodOpenBitSet(Int64)
Constructs an OpenBitSet large enough to hold numBits.
Public methodOpenBitSet(array<Int64>[]()[][], Int32)
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.

Methods

  NameDescription
Public methodAnd
Public methodAndNot
Public methodStatic memberAndNotCount
Returns the popcount or cardinality of "a and not b" or "intersection(a, not(b))". Neither set is modified.
Public methodStatic memberBits2words
returns the number of 64 bit words it would take to hold numBits
Public methodCapacity
Returns the current capacity in bits (1 greater than the index of the last bit)
Public methodCardinality
Public methodClear(Int64)
clears a bit, allowing access beyond the current set size without changing the size.
Public methodClear(Int32, Int32)
Clears a range of bits. Clearing past the end does not change the size of the set.
Public methodClear(Int64, Int64)
Clears a range of bits. Clearing past the end does not change the size of the set.
Public methodClone
Public methodEnsureCapacity
Ensure that the long[] is big enough to hold numBits, expanding it if necessary. getNumWords() is unchanged by this call.
Public methodEnsureCapacityWords
Expand the long[] with the size given as a number of words (64 bit longs). getNumWords() is unchanged by this call.
Public methodEquals
returns true if both sets have the same bits set
(Overrides Object..::..Equals(Object).)
Protected methodExpandingWordNum
Public methodFastClear(Int32)
clears a bit. The index should be less than the OpenBitSet size.
Public methodFastClear(Int64)
clears a bit. The index should be less than the OpenBitSet size.
Public methodFastFlip(Int32)
flips a bit. The index should be less than the OpenBitSet size.
Public methodFastFlip(Int64)
flips a bit. The index should be less than the OpenBitSet size.
Public methodFastGet(Int32)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size
Public methodFastGet(Int64)
Returns true or false for the specified bit index. The index should be less than the OpenBitSet size.
Public methodFastSet(Int32)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.
Public methodFastSet(Int64)
Sets the bit at the specified index. The index should be less than the OpenBitSet size.
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlip(Int64)
flips a bit, expanding the set size if necessary
Public methodFlip(Int64, Int64)
Flips a range of bits, expanding the set size if necessary
Public methodFlipAndGet(Int32)
flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
Public methodFlipAndGet(Int64)
flips a bit and returns the resulting bit value. The index should be less than the OpenBitSet size.
Public methodGet(Int32)
Returns true or false for the specified bit index.
Public methodGet(Int64)
Returns true or false for the specified bit index
Public methodGetAndSet(Int32)
Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
Public methodGetAndSet(Int64)
Sets a bit and returns the previous value. The index should be less than the OpenBitSet size.
Public methodGetBit
returns 1 if the bit is set, 0 if not. The index should be less than the OpenBitSet size
Public methodGetBits
Expert: returns the long[] storing the bits
Public methodGetHashCode (Overrides Object..::..GetHashCode()()()().)
Public methodGetNumWords
Expert: gets the number of longs in the array that are in use
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIntersect
this = this AND other
Public methodStatic memberIntersectionCount
Returns the popcount or cardinality of the intersection of the two sets. Neither set is modified.
Public methodIntersects
returns true if the sets have any elements in common
Public methodIsCacheable
This DocIdSet implementation is cacheable.
(Overrides DocIdSet..::..IsCacheable()()()().)
Public methodIsEmpty
Returns true if there are no set bits
Public methodIterator (Overrides DocIdSet..::..Iterator()()()().)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNextSetBit(Int32)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
Public methodNextSetBit(Int64)
Returns the index of the first set bit starting at the index specified. -1 is returned if there are no more set bits.
Public methodOr
Public methodRemove
Remove all elements set in other. this = this AND_NOT other
Public methodSet(Int64)
sets a bit, expanding the set size if necessary
Public methodSet(Int64, Int64)
Sets a range of bits, expanding the set size if necessary
Public methodSetBits
Expert: sets a new long[] to use as the bit storage
Public methodSetNumWords
Expert: sets the number of longs in the array that are in use
Public methodSize
Returns the current capacity of this set. Included for compatibility. This is *not* equal to {@link #cardinality}
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodTrimTrailingZeros
Lowers numWords, the number of words in use, by checking for trailing zero words.
Public methodUnion
this = this OR other
Public methodStatic memberUnionCount
Returns the popcount or cardinality of the union of the two sets. Neither set is modified.
Public methodXor
this = this XOR other
Public methodStatic memberXorCount
Returns the popcount or cardinality of the exclusive-or of the two sets. Neither set is modified.

Fields

  NameDescription
Protected fieldbits
Protected fieldwlen

See Also