aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java')
-rw-r--r--main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java b/main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java
index eff193a..f5cd208 100644
--- a/main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java
+++ b/main/src/cgeo/geocaching/connector/gc/UTFGridPosition.java
@@ -8,13 +8,13 @@ import java.util.regex.Pattern;
/**
* Representation of a position inside an UTFGrid
*/
-public final class UTFGridPosition {
+final class UTFGridPosition {
- public final int x;
- public final int y;
+ final int x;
+ final int y;
private final static Pattern PATTERN_JSON_KEY = Pattern.compile("[^\\d]*" + "(\\d+),\\s*(\\d+)" + "[^\\d]*"); // (12, 34)
- public UTFGridPosition(final int x, final int y) {
+ UTFGridPosition(final int x, final int y) {
if (x < 0 || x > UTFGrid.GRID_MAXX) {
throw new IllegalArgumentException("x outside bounds");
}
@@ -36,9 +36,8 @@ public final class UTFGridPosition {
/**
* @param key
* Key in the format (xx, xx)
- * @return
*/
- static UTFGridPosition fromString(String key) {
+ static UTFGridPosition fromString(final String key) {
final MatcherWrapper matcher = new MatcherWrapper(UTFGridPosition.PATTERN_JSON_KEY, key);
try {
if (matcher.matches()) {
@@ -46,7 +45,7 @@ public final class UTFGridPosition {
final int y = Integer.parseInt(matcher.group(2));
return new UTFGridPosition(x, y);
}
- } catch (NumberFormatException e) {
+ } catch (final NumberFormatException ignored) {
}
return new UTFGridPosition(0, 0);
}