|
||||||||||
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)
|
Method Summary | |
---|---|
int |
add(Hash peer)
Add the peer to the bucket |
Hash |
generateRandomKey()
Generate a random key to go within this bucket |
java.util.Set |
getEntries()
Retrieve all routing table entries stored in the bucket |
void |
getEntries(SelectionCollector collector)
|
java.util.Set |
getEntries(java.util.Set toIgnoreHashes)
Retrieve hashes stored in the bucket, excluding the ones specified |
int |
getKeyCount()
Number of keys already contained in this kbuckey |
Hash |
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(java.lang.String[] args)
Test harness to make sure its assigning keys to the right buckets |
boolean |
remove(Hash peer)
Remove the key from the bucket |
void |
setEntries(java.util.Set 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 |
java.lang.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, Hash local)
Method Detail |
---|
public int getRangeBegin()
KBucket
getRangeBegin
in interface KBucket
public int getRangeEnd()
KBucket
getRangeEnd
in interface KBucket
public void setRange(int lowOrderBitLimit, int highOrderBitLimit)
KBucket
setRange
in interface KBucket
public int getKeyCount()
KBucket
getKeyCount
in interface KBucket
public Hash getLocal()
getLocal
in interface KBucket
public boolean shouldContain(Hash key)
KBucket
shouldContain
in interface KBucket
public java.util.Set getEntries()
KBucket
getEntries
in interface KBucket
public java.util.Set getEntries(java.util.Set toIgnoreHashes)
KBucket
getEntries
in interface KBucket
public void getEntries(SelectionCollector collector)
getEntries
in interface KBucket
public void setEntries(java.util.Set entries)
KBucket
setEntries
in interface KBucket
entries
- set of Hash structurespublic int add(Hash peer)
KBucket
add
in interface KBucket
public boolean remove(Hash peer)
KBucket
remove
in interface KBucket
public Hash generateRandomKey()
generateRandomKey
in interface KBucket
public Hash getRangeBeginKey()
public Hash getRangeEndKey()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |