BitSet BitSet Class

Definition

The BitSet class implements a .

[Android.Runtime.Register("java/util/BitSet", ApiSince=1, DoNotGenerateAcw=true)]
public class BitSet : Java.Lang.Object, IDisposable, Java.IO.ISerializable, Java.Lang.ICloneable
type BitSet = class
    inherit Object
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface ICloneable
Inheritance
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

BitSet() BitSet()

Creates a new BitSet with size equal to 64 bits.

BitSet(Int32) BitSet(Int32)

Creates a new BitSet with size equal to bitCount, rounded up to a multiple of 64.

BitSet(IntPtr, JniHandleOwnership) BitSet(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsEmpty IsEmpty

Returns true if all the bits in this BitSet are set to false, false otherwise.

JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

And(BitSet) And(BitSet)

Logically ands the bits of this BitSet with bs.

AndNot(BitSet) AndNot(BitSet)

Clears all bits in this BitSet which are also set in bs.

Cardinality() Cardinality()

Returns the number of bits that are true in this BitSet.

Clear() Clear()

Clears all the bits in this BitSet.

Clear(Int32) Clear(Int32)

Clears the bit at index index.

Clear(Int32, Int32) Clear(Int32, Int32)

Clears the range of bits [fromIndex, toIndex).

Clone() Clone()

Creates and returns a copy of this Object.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Flip(Int32) Flip(Int32)

Flips the bit at index index.

Flip(Int32, Int32) Flip(Int32, Int32)

Flips the range of bits [fromIndex, toIndex).

Get(Int32) Get(Int32)

Returns the bit at index index.

Get(Int32, Int32) Get(Int32, Int32)

Returns a new BitSet containing the range of bits [fromIndex, toIndex), shifted down so that the bit at fromIndex is at bit 0 in the new BitSet.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
Intersects(BitSet) Intersects(BitSet)

Returns true if this.and(bs) is non-empty, but may be faster than computing that.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Length() Length()

Returns the number of bits up to and including the highest bit set.

NextClearBit(Int32) NextClearBit(Int32)

Returns the index of the first bit that is clear on or after index.

NextSetBit(Int32) NextSetBit(Int32)

Returns the index of the first bit that is set on or after index, or -1 if no higher bits are set.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Or(BitSet) Or(BitSet)

Logically ors the bits of this BitSet with bs.

PreviousClearBit(Int32) PreviousClearBit(Int32)

Returns the index of the first bit that is clear on or before index, or -1 if no lower bits are clear or index == -1.

PreviousSetBit(Int32) PreviousSetBit(Int32)

Returns the index of the first bit that is set on or before index, or -1 if no lower bits are set or index == -1.

Set(Int32) Set(Int32)

Sets the bit at index index to true.

Set(Int32, Boolean) Set(Int32, Boolean)

Sets the bit at index index to state.

Set(Int32, Int32) Set(Int32, Int32)

Sets the range of bits [fromIndex, toIndex).

Set(Int32, Int32, Boolean) Set(Int32, Int32, Boolean)

Sets the range of bits [fromIndex, toIndex) to state.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Size() Size()

Returns the capacity in bits of the array implementing this BitSet.

ToArray<T>() ToArray<T>() Inherited from Object
ToByteArray() ToByteArray()

Returns a new byte[] containing a little-endian representation the bits of this BitSet, suitable for passing to valueOf to reconstruct this BitSet.

ToLongArray() ToLongArray()

Returns a new long[] containing a little-endian representation of the bits of this BitSet, suitable for passing to valueOf to reconstruct this BitSet.

ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
ValueOf(ByteBuffer) ValueOf(ByteBuffer)

Returns a BitSet corresponding to byteBuffer, interpreted as a little-endian sequence of bits.

ValueOf(Byte[]) ValueOf(Byte[])

Equivalent to BitSet.valueOf(ByteBuffer.wrap(bytes)).

ValueOf(Int64[]) ValueOf(Int64[])

Equivalent to BitSet.valueOf(LongBuffer.wrap(longs)), but likely to be faster.

ValueOf(LongBuffer) ValueOf(LongBuffer)

Returns a BitSet corresponding to longBuffer, interpreted as a little-endian sequence of bits.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Xor(BitSet) Xor(BitSet)

Logically xors the bits of this BitSet with bs.

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to