public final class PieceIndexBitfield
extends java.lang.Object
| Constructor and Description |
|---|
PieceIndexBitfield(piece_index_bitfield f) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Make the bitfield empty, of zero size.
|
void |
clearAll()
Set all bits in the bitfield to 1 (set_all) or 0 (clear_all).
|
void |
clearBit(int index) |
int |
count()
Counts the number of bits in the bitfield that are set to 1.
|
int |
endIndex() |
int |
findFirstSet() |
int |
findLastClear() |
boolean |
getBit(int index) |
boolean |
isAllSet()
Returns true if all bits in the bitfield are set.
|
boolean |
isEmpty()
Returns true if the bitfield has zero size.
|
boolean |
isNoneSet() |
void |
resize(int bits) |
void |
resize(int bits,
boolean val)
Set the size of the bitfield to ``bits`` length.
|
void |
setAll()
Set all bits in the bitfield to 1 (set_all) or 0 (clear_all).
|
void |
setBit(int index) |
int |
size()
Returns the size of the bitfield in bits.
|
piece_index_bitfield |
swig() |
torrent_status |
ts()
This methods returns the internal torrent status or null
if it was constructed without one.
|
public PieceIndexBitfield(piece_index_bitfield f)
f - the native objectpublic piece_index_bitfield swig()
public torrent_status ts()
This also prevent premature garbage collection in case the storage was created from a torrent status.
public boolean getBit(int index)
index - the bit indexpublic void clearBit(int index)
index - the bit indexpublic void setBit(int index)
index - the bit indexpublic int endIndex()
public boolean isAllSet()
public boolean isNoneSet()
public int size()
public boolean isEmpty()
public int count()
public int findFirstSet()
public int findLastClear()
public void resize(int bits,
boolean val)
bits - the number of bitsval - the bits valuepublic void resize(int bits)
bits - the number of bitspublic void setAll()
public void clearAll()
public void clear()