public class SparseBitSet extends BitSet
Constructor and Description |
---|
SparseBitSet()
Initialise the bitset.
|
Modifier and Type | Method and Description |
---|---|
void |
and(BitSet set) |
void |
andNot(BitSet set) |
int |
cardinality() |
void |
clear() |
void |
clear(int bitIndex) |
void |
clear(int fromIndex,
int toIndex) |
Object |
clone() |
boolean |
equals(Object obj)
Two SparseBitSets are considered equal if they contain the same bits.
|
void |
flip(int bitIndex) |
void |
flip(int fromIndex,
int toIndex) |
boolean |
get(int bitIndex) |
BitSet |
get(int fromIndex,
int toIndex) |
int |
hashCode()
A hash code for this bit set.
|
boolean |
intersects(BitSet set) |
boolean |
isEmpty() |
int |
length() |
int |
nextClearBit(int fromIndex) |
int |
nextSetBit(int fromIndex) |
void |
or(BitSet set) |
void |
set(int bitIndex) |
void |
set(int bitIndex,
boolean value) |
void |
set(int fromIndex,
int toIndex) |
void |
set(int fromIndex,
int toIndex,
boolean value) |
int |
size()
In contrast with
BitSet.size() this does not return the size in bytes used to represent this set. |
String |
toString() |
void |
xor(BitSet set) |
previousClearBit, previousSetBit, stream, toByteArray, toLongArray, valueOf, valueOf, valueOf, valueOf
public SparseBitSet()
public int nextSetBit(int fromIndex)
nextSetBit
in class BitSet
public int nextClearBit(int fromIndex)
nextClearBit
in class BitSet
public boolean intersects(BitSet set)
intersects
in class BitSet
public int cardinality()
cardinality
in class BitSet
public int hashCode()
public int size()
BitSet.size()
this does not return the size in bytes used to represent this set.
Instead, it returns the same as length()
for compatibility with BitSet
. The actual space used is
a hashset of size cardinality()
.public boolean equals(Object obj)
Note: A SparseBitSet is never considered equal to a BitSet. This would be impossible to implement in a way so
equality is symmetric, since BitSet.equals(Object)
is implemented using its private fields to determine
equality.
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.