|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.BitSet dk.netarkivet.common.utils.SparseBitSet
public class SparseBitSet
A sparse implementation of a BitSet, that does not require memory linear to the largest index. This is done at the cost of performance, but should be fairly efficient on few set bits.
Constructor Summary | |
---|---|
SparseBitSet()
Initialise the bitset. |
Method Summary | |
---|---|
void |
and(java.util.BitSet set)
|
void |
andNot(java.util.BitSet set)
|
int |
cardinality()
|
void |
clear()
|
void |
clear(int bitIndex)
|
void |
clear(int fromIndex,
int toIndex)
|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.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)
|
java.util.BitSet |
get(int fromIndex,
int toIndex)
|
int |
hashCode()
A hash code for this bit set. |
boolean |
intersects(java.util.BitSet set)
|
boolean |
isEmpty()
|
int |
length()
|
int |
nextClearBit(int fromIndex)
|
int |
nextSetBit(int fromIndex)
|
void |
or(java.util.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. |
java.lang.String |
toString()
|
void |
xor(java.util.BitSet set)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SparseBitSet()
Method Detail |
---|
public void flip(int bitIndex)
flip
in class java.util.BitSet
BitSet.flip(int)
public void flip(int fromIndex, int toIndex)
flip
in class java.util.BitSet
BitSet.flip(int, int)
public void set(int bitIndex)
set
in class java.util.BitSet
BitSet.set(int)
public void set(int bitIndex, boolean value)
set
in class java.util.BitSet
BitSet.set(int, boolean)
public void set(int fromIndex, int toIndex)
set
in class java.util.BitSet
BitSet.set(int, int)
public void set(int fromIndex, int toIndex, boolean value)
set
in class java.util.BitSet
BitSet.set(int, int, boolean)
public void clear(int bitIndex)
clear
in class java.util.BitSet
BitSet.clear(int)
public void clear(int fromIndex, int toIndex)
clear
in class java.util.BitSet
BitSet.clear(int, int)
public void clear()
clear
in class java.util.BitSet
BitSet.clear()
public boolean get(int bitIndex)
get
in class java.util.BitSet
BitSet.get(int)
public java.util.BitSet get(int fromIndex, int toIndex)
get
in class java.util.BitSet
BitSet.get(int, int)
public int nextSetBit(int fromIndex)
nextSetBit
in class java.util.BitSet
BitSet.nextSetBit(int)
public int nextClearBit(int fromIndex)
nextClearBit
in class java.util.BitSet
BitSet.nextClearBit(int)
public int length()
length
in class java.util.BitSet
BitSet.length()
public boolean isEmpty()
isEmpty
in class java.util.BitSet
BitSet.isEmpty()
public boolean intersects(java.util.BitSet set)
intersects
in class java.util.BitSet
BitSet.intersects(BitSet)
public int cardinality()
cardinality
in class java.util.BitSet
BitSet.cardinality()
public void and(java.util.BitSet set)
and
in class java.util.BitSet
BitSet.and(BitSet)
public void or(java.util.BitSet set)
or
in class java.util.BitSet
BitSet.or(BitSet)
public void xor(java.util.BitSet set)
xor
in class java.util.BitSet
BitSet.xor(BitSet)
public void andNot(java.util.BitSet set)
andNot
in class java.util.BitSet
BitSet.andNot(BitSet)
public int hashCode()
hashCode
in class java.util.BitSet
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()
.
size
in class java.util.BitSet
public boolean equals(java.lang.Object obj)
BitSet.equals(Object)
is implemented using its private fields to
determine equality.
equals
in class java.util.BitSet
obj
- The object to compare for equality.
public java.lang.Object clone()
clone
in class java.util.BitSet
BitSet.clone()
public java.lang.String toString()
toString
in class java.util.BitSet
BitSet.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |