Class RandomTrimmer<T extends SimpleDataStructure>

    • Constructor Detail

      • RandomTrimmer

        public RandomTrimmer​(I2PAppContext ctx,
                             int max)
    • Method Detail

      • trim

        public boolean trim​(KBucket<T> kbucket,
                            T toAdd)
        Description copied from interface: KBucketTrimmer
        Called 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:
        trim in interface KBucketTrimmer<T extends SimpleDataStructure>
        Parameters:
        kbucket - the kbucket that is now too big
        Returns:
        true to actually add the entry.