Created
August 26, 2017 12:05
-
-
Save patrickyin/fb0c780f651004056f7533c17e8ba7f5 to your computer and use it in GitHub Desktop.
TilePosition class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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