<commit_before>package ru.atom.geometry;

/**
 * Created by gammaker on 01.03.2017.
 */
public class Bar implements Collider {
    public int left;
    public int bottom;
    public int width;
    public int height;

    public Bar(int x1, int y1, int x2, int y2) {
        left = x1;
        bottom = y1;
        width = x2 - x1;
        height = y2 - y1;
        if (width < 0) {
            left += width;
            width = -width;
        }
        if (height < 0) {
            bottom += height;
            height = -height;
        }
    }

    @Override
    public boolean isColliding(Collider other) {
        if (other instanceof Point) {
            return isColliding((Point) other);
        }
        if (other instanceof Bar) {
            return isColliding((Bar) other);
        }
        return false;
    }<commit_msg>Bar fields now private, added getters and setters<commit_after>package ru.atom.geometry;

/**
 * Created by gammaker on 01.03.2017.
 */
public class Bar implements Collider {
    private int left;
    private int bottom;
    private int width;
    private int height;

    public Bar(int x1, int y1, int x2, int y2) {
        setFromCorners(x1, y1, x2, y2);
    }
    
    public Bar setFromCorners(int x1, int y1, int x2, int y2) {
        left = x1;
        bottom = y1;
        setWidth(x2 - x1);
        setHeight(y2 - y1);
        return this;
    }
    
    public Bar setLeftX(int x) {
        left = x;
        return this;
    }
    
    public int getLeftX() {
        return left;
    }
    
    public Bar setBottomY(int y) {
        bottom = y;
        return this;
    }
    
    public int getBottomY() {
        return bottom;
    }
    
    public Bar setWidth(int width) {
        this.width = width;
        if (width < 0) {
            left += width;
            this.width = -width;
        }
        return this;
    }
    
    public int getWidth() {
        return width;
    }
    
    public Bar setHeight(int height) {
        this.height = height;
        if (height < 0) {
            bottom += height;
            height = -height;
        }
        return this;
    }
    
    public int getHeight() {
        return height;
    }
    

    @Override
    public boolean isColliding(Collider other) {
        if (other instanceof Point) {
            return isColliding((Point) other);
        }
        if (other instanceof Bar) {
            return isColliding((Bar) other);
        }
        return false;
    }
{'fraction_non_alphanumeric': 0.09427880741337631, 'fraction_numerical': 0.019339242546333603, 'mean_word_length': 1.4904714142427282, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1555802', 'n_tokens_mistral': 774, 'n_tokens_neox': 750, 'n_words': 229}