net.i2p.router.networkdb.kademlia
class KBucketSet extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BASE |
static int |
BUCKET_SIZE |
static int |
KEYSIZE_BITS |
static int |
NUM_BUCKETS |
Constructor and Description |
---|
KBucketSet(I2PAppContext context,
Hash us) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Hash peer)
Return true if the peer is new to the bucket it goes in, or false if it was
already in it
|
protected KBucket |
createBucket(int start,
int end) |
protected void |
createBuckets() |
void |
displayBuckets() |
Set<Hash> |
getAll() |
void |
getAll(SelectionCollector collector) |
Set<Hash> |
getAll(Set<Hash> toIgnore) |
KBucket |
getBucket(int bucket) |
static void |
main(String[] args) |
int |
pickBucket(Hash key) |
boolean |
remove(Hash entry) |
int |
size()
Not an exact count (due to concurrency issues) but generally correct
|
String |
toString() |
(package private) static String |
toString(byte[] b) |
public static final int BASE
public static final int KEYSIZE_BITS
public static final int NUM_BUCKETS
public static final int BUCKET_SIZE
public KBucketSet(I2PAppContext context, Hash us)
public boolean add(Hash peer)
public int size()
public boolean remove(Hash entry)
public void getAll(SelectionCollector collector)
public int pickBucket(Hash key)
public KBucket getBucket(int bucket)
protected void createBuckets()
protected KBucket createBucket(int start, int end)
public void displayBuckets()
static final String toString(byte[] b)
public static void main(String[] args)