org.nkjmlab.gis.datum.Tile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nkjmlab-utils-jpdatum Show documentation
Show all versions of nkjmlab-utils-jpdatum Show documentation
Utilities for Tokyo Datum, WGS84 and Japan Plane Rectangular
package org.nkjmlab.gis.datum;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.nkjmlab.gis.datum.jprect.util.TileUtils;
public class Tile {
private int x;
private int y;
private int zoom;
public Tile(int x, int y, int zoom) {
this.x = x;
this.y = y;
this.zoom = zoom;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZoom() {
return zoom;
}
public LatLonBox toLatLonBox(Basis basis) {
return TileUtils.toLatLonBox(this, basis);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object obj) {
return EqualsBuilder.reflectionEquals(this, obj);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
public Tile getNextX() {
return new Tile(x + 1, y, zoom);
}
public Tile getNextY() {
return new Tile(x, y + 1, zoom);
}
}