java.lang.Object
net.i2p.kademlia.KBucketSet.Range<T>
- Type Parameters:
T- the key type of the buckets
- Enclosing class:
KBucketSet<T extends SimpleDataStructure>
Calculator of the bucket range for a key.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BigIntegerOur key as a big integer.private final intB value from the kademlia paper.Cached range numbers, by key.Constructor Summary
Method Summary
All Methods
Field Details
_bValue
private final int _bValueB value from the kademlia paper._bigUs
Our key as a big integer._distanceCache
Cached range numbers, by key.
Constructor Details
Range
Builds the range calculator.- Parameters:
us- the local node's keybValue- the B value from the kademlia paper
Method Details
getRange
XOR distance range number for the given key — the B-aligned bucket range containing the key's distance from us.- Parameters:
key- the key to measure- Returns:
- the range number, or -1 for us
clear
public void clear()Clears the cached range numbers.