Skip to content

Instantly share code, notes, and snippets.

@patrickyin
Created August 26, 2017 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickyin/fb0c780f651004056f7533c17e8ba7f5 to your computer and use it in GitHub Desktop.
Save patrickyin/fb0c780f651004056f7533c17e8ba7f5 to your computer and use it in GitHub Desktop.
TilePosition class
public class TilePosition extends Object{
private int zoom;
private int x;
private int y;
public TilePosition(int zoom, int x, int y) {
this.zoom = zoom;
this.x = x;
this.y = y;
}
public int getZoom() {
return zoom;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TilePosition that = (TilePosition) o;
if (zoom != that.zoom) return false;
if (x != that.x) return false;
return y == that.y;
}
@Override
public int hashCode() {
int result = zoom;
result = 31 * result + x;
result = 31 * result + y;
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment