Java java.util BitSet fields, constructors, methods, implement or subclass

Example usage for Java java.util BitSet fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util BitSet.

The text is from its open source code.

Subclass

java.util.BitSet has subclasses.
Click this link to see all its subclasses.

Constructor

BitSet()
Creates a new bit set.
BitSet(int nbits)
Creates a bit set whose initial size is large enough to explicitly represent bits with indices in the range 0 through nbits-1 .
BitSet(long[] words)
Creates a bit set using words as the internal representation.

Method

voidand(BitSet set)
Performs a logical AND of this target bit set with the argument bit set.
voidandNot(BitSet set)
Clears all of the bits in this BitSet whose corresponding bit is set in the specified BitSet .
intcardinality()
Returns the number of bits set to true in this BitSet .
voidclear(int bitIndex)
Sets the bit specified by the index to false .
voidclear()
Sets all of the bits in this BitSet to false .
voidclear(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to false .
Objectclone()
Cloning this BitSet produces a new BitSet that is equal to it.
booleanequals(Object obj)
Compares this object against the specified object.
voidflip(int bitIndex)
Sets the bit at the specified index to the complement of its current value.
voidflip(int fromIndex, int toIndex)
Sets each bit from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to the complement of its current value.
booleanget(int bitIndex)
Returns the value of the bit with the specified index.
BitSetget(int fromIndex, int toIndex)
Returns a new BitSet composed of bits from this BitSet from fromIndex (inclusive) to toIndex (exclusive).
inthashCode()
Returns the hash code value for this bit set.
booleanintersects(BitSet set)
Returns true if the specified BitSet has any bits set to true that are also set to true in this BitSet .
booleanisEmpty()
Returns true if this BitSet contains no bits that are set to true .
intlength()
Returns the "logical size" of this BitSet : the index of the highest set bit in the BitSet plus one.
intnextClearBit(int fromIndex)
Returns the index of the first bit that is set to false that occurs on or after the specified starting index.
intnextSetBit(int fromIndex)
Returns the index of the first bit that is set to true that occurs on or after the specified starting index.
voidor(BitSet set)
Performs a logical OR of this bit set with the bit set argument.
intpreviousClearBit(int fromIndex)
Returns the index of the nearest bit that is set to false that occurs on or before the specified starting index.
intpreviousSetBit(int fromIndex)
Returns the index of the nearest bit that is set to true that occurs on or before the specified starting index.
voidset(int bitIndex)
Sets the bit at the specified index to true .
voidset(int bitIndex, boolean value)
Sets the bit at the specified index to the specified value.
voidset(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to true .
voidset(int fromIndex, int toIndex, boolean value)
Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to the specified value.
intsize()
Returns the number of bits of space actually in use by this BitSet to represent bit values.
byte[]toByteArray()
Returns a new byte array containing all the bits in this bit set.
long[]toLongArray()
Returns a new long array containing all the bits in this bit set.
StringtoString()
Returns a string representation of this bit set.
BitSetvalueOf(long[] longs)
Returns a new bit set containing all the bits in the given long array.
BitSetvalueOf(LongBuffer lb)
Returns a new bit set containing all the bits in the given long buffer between its position and limit.
BitSetvalueOf(byte[] bytes)
Returns a new bit set containing all the bits in the given byte array.
BitSetvalueOf(ByteBuffer bb)
Returns a new bit set containing all the bits in the given byte buffer between its position and limit.
voidxor(BitSet set)
Performs a logical XOR of this bit set with the bit set argument.