BitSet (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
void
[and](../../java/util/BitSet.html#and-java.util.BitSet-)([BitSet](../../java/util/BitSet.html "class in java.util") set)
Performs a logical AND of this target bit set with the argument bit set.
void
[andNot](../../java/util/BitSet.html#andNot-java.util.BitSet-)([BitSet](../../java/util/BitSet.html "class in java.util") set)
Clears all of the bits in this BitSet
whose corresponding bit is set in the specified BitSet
.
int
[cardinality](../../java/util/BitSet.html#cardinality--)()
Returns the number of bits set to true
in this BitSet
.
void
[clear](../../java/util/BitSet.html#clear--)()
Sets all of the bits in this BitSet to false
.
void
[clear](../../java/util/BitSet.html#clear-int-)(int bitIndex)
Sets the bit specified by the index to false
.
void
[clear](../../java/util/BitSet.html#clear-int-int-)(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex
(inclusive) to the specified toIndex
(exclusive) to false
.
[Object](../../java/lang/Object.html "class in java.lang")
[clone](../../java/util/BitSet.html#clone--)()
Cloning this BitSet
produces a new BitSet
that is equal to it.
boolean
[equals](../../java/util/BitSet.html#equals-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") obj)
Compares this object against the specified object.
void
[flip](../../java/util/BitSet.html#flip-int-)(int bitIndex)
Sets the bit at the specified index to the complement of its current value.
void
[flip](../../java/util/BitSet.html#flip-int-int-)(int fromIndex, int toIndex)
Sets each bit from the specified fromIndex
(inclusive) to the specified toIndex
(exclusive) to the complement of its current value.
boolean
[get](../../java/util/BitSet.html#get-int-)(int bitIndex)
Returns the value of the bit with the specified index.
[BitSet](../../java/util/BitSet.html "class in java.util")
[get](../../java/util/BitSet.html#get-int-int-)(int fromIndex, int toIndex)
Returns a new BitSet
composed of bits from this BitSet
from fromIndex
(inclusive) to toIndex
(exclusive).
int
[hashCode](../../java/util/BitSet.html#hashCode--)()
Returns the hash code value for this bit set.
boolean
[intersects](../../java/util/BitSet.html#intersects-java.util.BitSet-)([BitSet](../../java/util/BitSet.html "class in java.util") set)
Returns true if the specified BitSet
has any bits set totrue
that are also set to true
in this BitSet
.
boolean
[isEmpty](../../java/util/BitSet.html#isEmpty--)()
Returns true if this BitSet
contains no bits that are set to true
.
int
[length](../../java/util/BitSet.html#length--)()
Returns the "logical size" of this BitSet
: the index of the highest set bit in the BitSet
plus one.
int
[nextClearBit](../../java/util/BitSet.html#nextClearBit-int-)(int fromIndex)
Returns the index of the first bit that is set to false
that occurs on or after the specified starting index.
int
[nextSetBit](../../java/util/BitSet.html#nextSetBit-int-)(int fromIndex)
Returns the index of the first bit that is set to true
that occurs on or after the specified starting index.
void
[or](../../java/util/BitSet.html#or-java.util.BitSet-)([BitSet](../../java/util/BitSet.html "class in java.util") set)
Performs a logical OR of this bit set with the bit set argument.
int
[previousClearBit](../../java/util/BitSet.html#previousClearBit-int-)(int fromIndex)
Returns the index of the nearest bit that is set to false
that occurs on or before the specified starting index.
int
[previousSetBit](../../java/util/BitSet.html#previousSetBit-int-)(int fromIndex)
Returns the index of the nearest bit that is set to true
that occurs on or before the specified starting index.
void
[set](../../java/util/BitSet.html#set-int-)(int bitIndex)
Sets the bit at the specified index to true
.
void
[set](../../java/util/BitSet.html#set-int-boolean-)(int bitIndex, boolean value)
Sets the bit at the specified index to the specified value.
void
[set](../../java/util/BitSet.html#set-int-int-)(int fromIndex, int toIndex)
Sets the bits from the specified fromIndex
(inclusive) to the specified toIndex
(exclusive) to true
.
void
[set](../../java/util/BitSet.html#set-int-int-boolean-)(int fromIndex, int toIndex, boolean value)
Sets the bits from the specified fromIndex
(inclusive) to the specified toIndex
(exclusive) to the specified value.
int
[size](../../java/util/BitSet.html#size--)()
Returns the number of bits of space actually in use by thisBitSet
to represent bit values.
[IntStream](../../java/util/stream/IntStream.html "interface in java.util.stream")
[stream](../../java/util/BitSet.html#stream--)()
Returns a stream of indices for which this BitSet
contains a bit in the set state.
byte[]
[toByteArray](../../java/util/BitSet.html#toByteArray--)()
Returns a new byte array containing all the bits in this bit set.
long[]
[toLongArray](../../java/util/BitSet.html#toLongArray--)()
Returns a new long array containing all the bits in this bit set.
[String](../../java/lang/String.html "class in java.lang")
[toString](../../java/util/BitSet.html#toString--)()
Returns a string representation of this bit set.
static [BitSet](../../java/util/BitSet.html "class in java.util")
[valueOf](../../java/util/BitSet.html#valueOf-byte:A-)(byte[] bytes)
Returns a new bit set containing all the bits in the given byte array.
static [BitSet](../../java/util/BitSet.html "class in java.util")
[valueOf](../../java/util/BitSet.html#valueOf-java.nio.ByteBuffer-)([ByteBuffer](../../java/nio/ByteBuffer.html "class in java.nio") bb)
Returns a new bit set containing all the bits in the given byte buffer between its position and limit.
static [BitSet](../../java/util/BitSet.html "class in java.util")
[valueOf](../../java/util/BitSet.html#valueOf-long:A-)(long[] longs)
Returns a new bit set containing all the bits in the given long array.
static [BitSet](../../java/util/BitSet.html "class in java.util")
[valueOf](../../java/util/BitSet.html#valueOf-java.nio.LongBuffer-)([LongBuffer](../../java/nio/LongBuffer.html "class in java.nio") lb)
Returns a new bit set containing all the bits in the given long buffer between its position and limit.
void
[xor](../../java/util/BitSet.html#xor-java.util.BitSet-)([BitSet](../../java/util/BitSet.html "class in java.util") set)
Performs a logical XOR of this bit set with the bit set argument.