package org.libreoffice;

import android.graphics.RectF;

import org.mozilla.gecko.gfx.IntSize;

public class TileIdentifier {
    public final int x;
    public final int y;
    public final float zoom;
    public final IntSize size;

    public TileIdentifier(int x, int y, float zoom, IntSize size) {
        this.x = x;
        this.y = y;
        this.zoom = zoom;
        this.size = size;
    }

    public RectF getRect() {
        return new RectF(x, y, x + size.width, y + size.height);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TileIdentifier that = (TileIdentifier) o;

        if (x != that.x) return false;
        if (y != that.y) return false;
        if (Float.compare(that.zoom, zoom) != 0) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = x;
        result = 31 * result + y;
        result = 31 * result + (zoom != +0.0f ? Float.floatToIntBits(zoom) : 0);
        return result;
    }
}
@@ -1083,10 +1083,172 @@
 t;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return String.format(%22TileIdentifier (%25d, %25d) z=%25f s=(%25d, %25d)%22, x, y, zoom, size.width, size.height);%0A    %7D
 %0A%7D

add toString to TileIdentifier