|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStateBitSet
Created by IntelliJ IDEA. User: julien Date: 12 juil. 2007 Time: 10:16:08
Method Summary | |
---|---|
void |
and(IStateBitSet other)
|
void |
andNot(IStateBitSet other)
|
int |
capacity()
|
int |
cardinality()
Number of bits on. |
void |
clear()
Remove all bits; |
void |
clear(int bitIndex)
Puts the specified bit off. |
void |
clear(int fromIndex,
int toIndex)
|
IStateBitSet |
copy()
|
BitSet |
copyToBitSet()
|
void |
flip(int bitIndex)
|
void |
flip(int fromIndex,
int toIndex)
|
boolean |
get(int bitIndex)
|
boolean |
intersects(IStateBitSet setI)
|
boolean |
isEmpty()
|
int |
nextClearBit(int fromIndex)
|
int |
nextSetBit(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(IStateBitSet other)
|
int |
prevClearBit(int fromIndex)
|
int |
prevSetBit(int fromIndex)
Returns the index of the first bit that is set to true
that occurs on or before the specified starting index. |
void |
set(int bitIndex)
Puts the specified bit on. |
void |
set(int index,
boolean value)
|
void |
set(int fromIdex,
int toIndex)
|
int |
size()
Size of the bitset |
void |
xor(IStateBitSet other)
|
Method Detail |
---|
int cardinality()
int size()
void set(int bitIndex)
bitIndex
- the bit to put onvoid clear(int bitIndex)
bitIndex
- the bit to put offvoid clear()
void clear(int fromIndex, int toIndex)
void set(int index, boolean value)
void set(int fromIdex, int toIndex)
boolean get(int bitIndex)
int nextSetBit(int fromIndex)
true
that occurs on or after the specified starting index. If no such
bit exists then -1 is returned.
To iterate over the true
bits in a BitSet
,
use the following loop:
for(int i=bs.nextSetBit(0); i>=0; i=bs.nextSetBit(i+1)) {
// operate on index i here
}
fromIndex
- the index to start checking from (inclusive).
IndexOutOfBoundsException
- if the specified index is negative.int prevSetBit(int fromIndex)
true
that occurs on or before the specified starting index. If no such
bit exists then -1 is returned.
fromIndex
- the index to start checking from (inclusive).
IndexOutOfBoundsException
- if the specified index is
negative or too largeint nextClearBit(int fromIndex)
int prevClearBit(int fromIndex)
int capacity()
IStateBitSet copy()
BitSet copyToBitSet()
void or(IStateBitSet other)
void and(IStateBitSet other)
void xor(IStateBitSet other)
void andNot(IStateBitSet other)
boolean intersects(IStateBitSet setI)
void flip(int bitIndex)
void flip(int fromIndex, int toIndex)
boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |