<commit_before>package bt.torrent;

import java.util.function.Predicate;

/**
 * Implements a particular piece selection algorithm.
 *
 * @see bt.torrent.selector.PieceSelector
 * @since 1.0
 */
public interface PieceSelectionStrategy {

    /**
     * Returns an array of piece indices, selected from the overall piece statistics
     *
     * @param pieceStats Per-torrent piece statistics
     * @param limit Upper bound for the number of indices to collect
     * @param pieceIndexValidator Tells whether piece index might be selected.
     *                            Only pieces for which this function returns true have a chance to be selected.
     * @return Array of length lesser than or equal to {@code limit}
     * @since 1.0
     */
    Integer[] getNextPieces(PieceStatistics pieceStats, int limit, Predicate<Integer> pieceIndexValidator);
}<commit_msg>javadoc<commit_after>package bt.torrent;

import java.util.function.Predicate;

/**
 * Implements a piece selection algorithm.
 *
 * @see bt.torrent.selector.PieceSelector
 * @since 1.0
 */
public interface PieceSelectionStrategy {

    /**
     * Returns an array of piece indices, selected from the overall piece statistics
     *
     * @param pieceStats Per-torrent piece statistics
     * @param limit Upper bound for the number of indices to collect
     * @param pieceIndexValidator Tells whether piece index might be selected.
     *                            Only pieces for which this function returns true have a chance to be selected.
     * @return Array of length lesser than or equal to {@code limit}
     * @since 1.0
     */
    Integer[] getNextPieces(PieceStatistics pieceStats, int limit, Predicate<Integer> pieceIndexValidator);
}
{'fraction_non_alphanumeric': 0.07205113306217316, 'fraction_numerical': 0.004648460197559558, 'mean_word_length': 3.1, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7319089', 'n_tokens_mistral': 442, 'n_tokens_neox': 433, 'n_words': 175}