package epson.print.phlayout;

import android.graphics.Rect;
import android.graphics.RectF;

public class AltRect {
    int bottom;
    int left;
    int right;
    int top;

    public AltRect() {
    }

    public AltRect(int i, int i2, int i3, int i4) {
        left = i;
        top = i2;
        right = i3;
        bottom = i4;
    }

    AltRect(AltRect altRect) {
        left = altRect.left;
    }

    private int width() {
        return right - left;
    }

    private int height() {
        return bottom - top;
    }

    private int centerX() {
        return (this.left + right) >> 1;
    }

    private int centerY() {
        return (this.top + bottom) >> 1;
    }

    public Rect getRect() {
        return new Rect(this.left, top, right, bottom);
    }

    public RectF getRectF() {
        return new RectF((float) left, (float) top, (float) right, (float) bottom);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        AltRect altRect = (AltRect) obj;
        if (this.left == altRect.left && top == altRect.top && right == altRect.right && bottom == altRect.bottom) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        return (((((this.left * 31) + top) * 31) + right) * 31) + bottom;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(32);
        sb.append("AltRect(");
        sb.append(this.left);
        sb.append(PreferencesConstants.COOKIE_DELIMITER);
        sb.append(this.top);
        sb.append(PreferencesConstants.COOKIE_DELIMITER);
        sb.append(this.right);
        sb.append(PreferencesConstants.COOKIE_DELIMITER);
        sb.append(this.bottom);
        sb.append(")");
        return sb.toString();
    }
}
