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) {
- 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 (left + right) >> 1;
- }
- private int centerY() {
- return (top + bottom) >> 1;
- }
- public Rect getRect() {
- return new Rect(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 (left == altRect.left && top == altRect.top && right == altRect.right && bottom == altRect.bottom) {
- return true;
- }
- return false;
- }
- public int hashCode() {
- return (((((left * 31) + top) * 31) + right) * 31) + bottom;
- }
- public String toString() {
- StringBuilder sb = new StringBuilder(32);
- sb.append("AltRect(");
- sb.append(left);
- sb.append(PreferencesConstants.COOKIE_DELIMITER);
- sb.append(top);
- sb.append(PreferencesConstants.COOKIE_DELIMITER);
- sb.append(right);
- sb.append(PreferencesConstants.COOKIE_DELIMITER);
- sb.append(bottom);
- sb.append(")");
- return sb.toString();
- }
- }
|