<commit_before>/**
 * Created by michalsvacha on 21.02.17.
 */
public class Slice {
    int originX;
    int originY;
    int endX;
    int endY;

    int tomatoCount = 0;
    int mushroomCount = 0;

    public Slice(int originX, int originY, char ingredient) {
        this.originX = originX;
        this.originY = originY;
        this.endX= originX;
        this.endY = originY;
        this.addIngredient(ingredient);
    }

    public int size() {
        return (endX - originX) * (endY - originY);
    }

    public void addIngredient(char ingredient) {
        if (ingredient == 'T') {
            tomatoCount++;
        } else {
            mushroomCount++;
        }
    }
    
    public void updateIngredients(char[][] pizza) {
        tomatoCount = 0;
        mushroomCount = 0;

        for (int i = originX; i < endX; i++) {
            for (int j = originY; j < endY; j++) {
                addIngredient(pizza[i][j]);
            }
        }
    }

    /**
     * Getters & Setters
     */

    public int getOriginX() {
        return originX;
    }

    public void setOriginX(int originX) {
        this.originX = originX;
    }

    public int getOriginY() {
        return originY;
    }<commit_msg>isComplete function<commit_after>/**
 * Created by michalsvacha on 21.02.17.
 */
public class Slice {
    int originX;
    int originY;
    int endX;
    int endY;

    int tomatoCount = 0;
    int mushroomCount = 0;

    public Slice(int originX, int originY, char ingredient) {
        this.originX = originX;
        this.originY = originY;
        this.endX= originX;
        this.endY = originY;
        this.addIngredient(ingredient);
    }

    public int size() {
        return (endX - originX) * (endY - originY);
    }

    public void addIngredient(char ingredient) {
        if (ingredient == 'T') {
            tomatoCount++;
        } else {
            mushroomCount++;
        }
    }
    
    public void updateIngredients(char[][] pizza) {
        tomatoCount = 0;
        mushroomCount = 0;

        for (int i = originX; i < endX; i++) {
            for (int j = originY; j < endY; j++) {
                addIngredient(pizza[i][j]);
            }
        }
    }

    public boolean isComplete(int constraint) {
        return tomatoCount >= constraint && mushroomCount >= constraint;
    }

    /**
     * Getters & Setters
     */

    public int getOriginX() {
        return originX;
    }

    public void setOriginX(int originX) {
        this.originX = originX;
    }

    public int getOriginY() {
        return originY;
    }
{'fraction_non_alphanumeric': 0.11132660977501939, 'fraction_numerical': 0.007757951900698216, 'mean_word_length': 1.711882229232387, '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': '5798151', 'n_tokens_mistral': 869, 'n_tokens_neox': 818, 'n_words': 206}