|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.router.networkdb.kademlia.KBucketImpl
class KBucketImpl
| Constructor Summary | |
|---|---|
KBucketImpl(I2PAppContext context,
Hash local)
for testing - use above constructor for production to get common caching |
|
KBucketImpl(I2PAppContext context,
LocalHash local)
|
|
| Method Summary | |
|---|---|
int |
add(Hash peer)
Todo: shuffling here is a hack and doesn't work since we switched back to a HashSet implementation |
Hash |
generateRandomKey()
Generate a random key to go within this bucket WARNING - Something is seriously broken here. |
Set<Hash> |
getEntries()
Retrieve all routing table entries stored in the bucket |
void |
getEntries(SelectionCollector collector)
|
Set<Hash> |
getEntries(Set toIgnoreHashes)
Deprecated. makes a copy, remove toIgnore in KBS instead |
int |
getKeyCount()
Number of keys already contained in this kbuckey |
LocalHash |
getLocal()
|
int |
getRangeBegin()
lowest order high bit for difference keys |
Hash |
getRangeBeginKey()
|
int |
getRangeEnd()
highest high bit for the difference keys |
Hash |
getRangeEndKey()
|
static void |
main(String[] args)
Test harness to make sure its assigning keys to the right buckets WARNING - Something is seriously broken here. |
boolean |
remove(Hash peer)
Remove the key from the bucket |
void |
setEntries(Set<Hash> entries)
Fill the bucket with entries |
void |
setRange(int lowOrderBitLimit,
int highOrderBitLimit)
Set the range low and high bits for difference keys |
boolean |
shouldContain(Hash key)
whether or not the key qualifies as part of this bucket |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public KBucketImpl(I2PAppContext context,
LocalHash local)
public KBucketImpl(I2PAppContext context,
Hash local)
| Method Detail |
|---|
public int getRangeBegin()
KBucket
getRangeBegin in interface KBucketpublic int getRangeEnd()
KBucket
getRangeEnd in interface KBucket
public void setRange(int lowOrderBitLimit,
int highOrderBitLimit)
KBucket
setRange in interface KBucketpublic int getKeyCount()
KBucket
getKeyCount in interface KBucketpublic LocalHash getLocal()
getLocal in interface KBucketpublic boolean shouldContain(Hash key)
KBucket
shouldContain in interface KBucketpublic Set<Hash> getEntries()
KBucket
getEntries in interface KBucketpublic Set<Hash> getEntries(Set toIgnoreHashes)
KBucket
getEntries in interface KBucketpublic void getEntries(SelectionCollector collector)
getEntries in interface KBucketpublic void setEntries(Set<Hash> entries)
KBucket
setEntries in interface KBucketentries - set of Hash structurespublic int add(Hash peer)
add in interface KBucketpublic boolean remove(Hash peer)
KBucket
remove in interface KBucketpublic Hash generateRandomKey()
generateRandomKey in interface KBucketpublic Hash getRangeBeginKey()
public Hash getRangeEndKey()
public String toString()
toString in class Objectpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||