|
16 | 16 |
|
17 | 17 | package com.mapcode.example; |
18 | 18 |
|
19 | | -import java.util.List; |
20 | | - |
21 | 19 | import com.mapcode.Mapcode; |
22 | 20 | import com.mapcode.MapcodeInfo; |
23 | 21 | import com.mapcode.ParentTerritory; |
|
26 | 24 | import com.mapcode.UnknownMapcodeException; |
27 | 25 | import com.mapcode.UnknownTerritoryException; |
28 | 26 |
|
| 27 | +import java.util.List; |
| 28 | + |
29 | 29 | /** |
30 | 30 | * This class serves as an example of how to use the Mapcode Java library. |
31 | 31 | */ |
@@ -71,9 +71,9 @@ private static void exampleDecode() throws UnknownTerritoryException { |
71 | 71 | final String mapcode2 = "NLD 49.4V"; |
72 | 72 | try { |
73 | 73 | final Point p = Mapcode.decode(mapcode2); |
74 | | - System.out.println("Mapcode " + mapcode2 + " in territory " |
75 | | - + territory + " represents latitude " + p.getLatDeg() |
76 | | - + ", longitude " + p.getLonDeg()); |
| 74 | + System.out.println("Mapcode " + mapcode2 + " in territory " |
| 75 | + + territory + " represents latitude " + p.getLatDeg() |
| 76 | + + ", longitude " + p.getLonDeg()); |
77 | 77 | } |
78 | 78 | catch (final UnknownMapcodeException ignored) { |
79 | 79 | System.out.println("This should never happen in this example as the Mapcode is valid."); |
@@ -109,19 +109,20 @@ private static void exampleDecode() throws UnknownTerritoryException { |
109 | 109 | System.out.println("This should never happen in this example as the Mapcode is valid."); |
110 | 110 | } |
111 | 111 |
|
112 | | - /** |
113 | | - * The fifth example tries to decode a valid Mapcode that contains |
114 | | - * Unicode characters. This will succeed. |
115 | | - */ |
116 | | - final String mapcode5 = "JPN チナ.8チ"; |
117 | | - try { |
118 | | - final Point p = Mapcode.decode(mapcode5); |
119 | | - System.out.println("Mapcode " + mapcode5 + " represents latitude " |
120 | | - + p.getLatDeg() + ", longitude " + p.getLonDeg()); |
121 | | - } catch (final UnknownMapcodeException ignored) { |
122 | | - System.out |
123 | | - .println("This should never happen in this example as the Mapcode is valid."); |
124 | | - } |
| 112 | + /** |
| 113 | + * The fifth example tries to decode a valid Mapcode that contains |
| 114 | + * Unicode characters. This will succeed. |
| 115 | + */ |
| 116 | + final String mapcode5 = "JPN チナ.8チ"; |
| 117 | + try { |
| 118 | + final Point p = Mapcode.decode(mapcode5); |
| 119 | + System.out.println("Mapcode " + mapcode5 + " represents latitude " |
| 120 | + + p.getLatDeg() + ", longitude " + p.getLonDeg()); |
| 121 | + } |
| 122 | + catch (final UnknownMapcodeException ignored) { |
| 123 | + System.out |
| 124 | + .println("This should never happen in this example as the Mapcode is valid."); |
| 125 | + } |
125 | 126 |
|
126 | 127 | System.out.println(""); |
127 | 128 | } |
|
0 commit comments