123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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) {
- this.left = i;
- this.top = i2;
- this.right = i3;
- this.bottom = i4;
- }
- AltRect(AltRect altRect) {
- this.left = altRect.left;
- }
- private int width() {
- return this.right - this.left;
- }
- private int height() {
- return this.bottom - this.top;
- }
- private int centerX() {
- return (this.left + this.right) >> 1;
- }
- private int centerY() {
- return (this.top + this.bottom) >> 1;
- }
- public Rect getRect() {
- return new Rect(this.left, this.top, this.right, this.bottom);
- }
- public RectF getRectF() {
- return new RectF((float) this.left, (float) this.top, (float) this.right, (float) this.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 && this.top == altRect.top && this.right == altRect.right && this.bottom == altRect.bottom) {
- return true;
- }
- return false;
- }
- public int hashCode() {
- return (((((this.left * 31) + this.top) * 31) + this.right) * 31) + this.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();
- }
- }
|