Kaydet (Commit) 0d3e2ee5 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

android: SubTile - equals and hash

Change-Id: I6e8cf220d108cefdf16f9b4553e2d2ecd7a5338c
üst a5506803
...@@ -22,4 +22,26 @@ public class SubTile extends SingleTileLayer { ...@@ -22,4 +22,26 @@ public class SubTile extends SingleTileLayer {
public void markForRemoval() { public void markForRemoval() {
markedForRemoval = true; markedForRemoval = true;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SubTile subTile = (SubTile) o;
if (x != subTile.x) return false;
if (y != subTile.y) return false;
if (Float.compare(subTile.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;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment