java.lang.Object
net.i2p.kademlia.RejectTrimmer<T>
- Type Parameters:
T- type of SimpleDataStructure objects in the bucket
- All Implemented Interfaces:
KBucketTrimmer<T>
public class RejectTrimmer<T extends SimpleDataStructure>extends Object implements KBucketTrimmer<T>
Removes nothing and always rejects the add. Flood resistant..
Constructor Summary
ConstructorsConstructorDescriptionA bare instance is enough:trim(KBucket, T)reads no field, so every instance behaves the same way and refuses the add.Method Summary
All Methods
Constructor Details
RejectTrimmer
public RejectTrimmer()A bare instance is enough:trim(KBucket, T)reads no field, so every instance behaves the same way and refuses the add.
Method Details
trim
Description copied from interface:KBucketTrimmerCalled from add() just before adding the entry. You may call getEntries() and/or remove() from here. Do NOT call add(). To always discard a newer entry, always return false.- Specified by:
trimin interfaceKBucketTrimmer<T extends SimpleDataStructure>- Parameters:
kbucket- the kbucket that is now too bigtoAdd- the entry the bucket is about to accept- Returns:
- true to actually add the entry.