aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/connector/gc/Tile.java
diff options
context:
space:
mode:
authorcampbeb <bpcampbell@gmail.com>2012-03-18 12:41:39 +0900
committercampbeb <bpcampbell@gmail.com>2012-03-18 12:41:39 +0900
commit04759a13bf0543a81c0fe1cb87e4e9f8bdabd581 (patch)
tree0d6c8e0b5564b54b36ddc347f9392cc04b52e427 /main/src/cgeo/geocaching/connector/gc/Tile.java
parent254bd0204e5521bea6bd96d946b84ecbb89f8c89 (diff)
downloadcgeo-04759a13bf0543a81c0fe1cb87e4e9f8bdabd581.zip
cgeo-04759a13bf0543a81c0fe1cb87e4e9f8bdabd581.tar.gz
cgeo-04759a13bf0543a81c0fe1cb87e4e9f8bdabd581.tar.bz2
Optimization - Avoid use of internal getters.
See http://developer.android.com/guide/practices/design/performance.html#internal_get_set
Diffstat (limited to 'main/src/cgeo/geocaching/connector/gc/Tile.java')
-rw-r--r--main/src/cgeo/geocaching/connector/gc/Tile.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/Tile.java b/main/src/cgeo/geocaching/connector/gc/Tile.java
index eec83b0..b76cae9 100644
--- a/main/src/cgeo/geocaching/connector/gc/Tile.java
+++ b/main/src/cgeo/geocaching/connector/gc/Tile.java
@@ -123,7 +123,7 @@ public class Tile {
* Calculates the maximum possible zoom level where the supplied points
* are covered by adjacent tiles on the east/west axis.
* The order of the points (left/right) is irrelevant.
- *
+ *
* @param left
* First point
* @param right
@@ -140,7 +140,7 @@ public class Tile {
Tile tileLeft = new Tile(left, zoom);
Tile tileRight = new Tile(right, zoom);
- if (tileLeft.getX() == tileRight.getX()) {
+ if (tileLeft.tileX == tileRight.tileX) {
zoom = zoom + 1;
}
@@ -151,7 +151,7 @@ public class Tile {
* Calculates the maximum possible zoom level where the supplied points
* are covered by adjacent tiles on the north/south axis.
* The order of the points (bottom/top) is irrelevant.
- *
+ *
* @param bottom
* First point
* @param top
@@ -172,7 +172,7 @@ public class Tile {
Tile tileBottom = new Tile(bottom, zoom);
Tile tileTop = new Tile(top, zoom);
- if (Math.abs(tileBottom.getY() - tileTop.getY()) > 1) {
+ if (Math.abs(tileBottom.tileY - tileTop.tileY) > 1) {
zoom = zoom - 1;
}
@@ -186,7 +186,7 @@ public class Tile {
/**
* Calculates the inverted hyperbolic sine
* (after Bronstein, Semendjajew: Taschenbuch der Mathematik
- *
+ *
* @param x
* @return
*/
@@ -202,9 +202,9 @@ public class Tile {
if (!(o instanceof Tile)) {
return false;
}
- return (this.getX() == ((Tile) o).getX())
- && (this.getY() == ((Tile) o).getY())
- && (this.getZoomlevel() == ((Tile) o).getZoomlevel());
+ return (this.tileX == ((Tile) o).tileX)
+ && (this.tileY == ((Tile) o).tileY)
+ && (this.zoomlevel == ((Tile) o).zoomlevel);
}
@Override