<commit_before>package net.sf.jranges.range;

import java.util.Collection;

import net.sf.jranges.range.doublerange.DoubleRange;
import net.sf.jranges.range.integer.IntegerRange;
import net.sf.kerner.utils.math.MathUtils;

public class RangeUtils {
	
	public interface IntegerRangeCallback {
		void call(int i);
	}
	
	public interface DoubleRangeTask {
		void call(double d);
	}
	
	private RangeUtils(){}
	
	public static boolean includesAll(IntegerRange range, Collection<? extends Integer> positions){
		for(int i : positions){
			if(range.includes(i)){
				// ok
			} else {
				return false;
			}
		}
		return true;
	}
	
	public static void doForAllInRange(IntegerRange range, IntegerRangeCallback task){
		for(int i = range.getStart(); i <= range.getStop(); i+= range.getInterval()){
			task.call(i);
		}
	}
	
	public static void doForAllInRange(DoubleRange range, DoubleRangeTask task){<commit_msg>[API-Break] Refactor RangeUtils#IntegerRangeCallBack to RangeUtils#IntegerRangeTask.<commit_after>package net.sf.jranges.range;

import java.util.Collection;

import net.sf.jranges.range.doublerange.DoubleRange;
import net.sf.jranges.range.integer.IntegerRange;
import net.sf.kerner.utils.math.MathUtils;

public class RangeUtils {
	
	public interface IntegerRangeTask {
		void call(int i);
	}
	
	public interface DoubleRangeTask {
		void call(double d);
	}
	
	private RangeUtils(){}
	
	public static boolean includesAll(IntegerRange range, Collection<? extends Integer> positions){
		for(int i : positions){
			if(range.includes(i)){
				// ok
			} else {
				return false;
			}
		}
		return true;
	}
	
	public static void doForAllInRange(IntegerRange range, IntegerRangeTask task){
		for(int i = range.getStart(); i <= range.getStop(); i+= range.getInterval()){
			task.call(i);
		}
	}
	
	public static void doForAllInRange(DoubleRange range, DoubleRangeTask task){
{'fraction_non_alphanumeric': 0.1122394441475147, 'fraction_numerical': 0.0, 'mean_word_length': 4.426086956521739, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4886400', 'n_tokens_mistral': 649, 'n_tokens_neox': 579, 'n_words': 139}