Skip to content

Commit f550584

Browse files
committed
Fixed minor JavaDoc issues
1 parent bc0d57b commit f550584

File tree

11 files changed

+57
-54
lines changed

11 files changed

+57
-54
lines changed

src/main/java/com/mapcode/Alphabet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* This enum defines all alphabets supported for mapcodes. Note that an alphabet is different from a
2525
* language or locale. An alternative name for an alphabet is "script".
26-
* <p/>
26+
*
2727
* Mapcodes can be safely converted between alphabets and fed to the mapcode decoder in the regular
2828
* ASCII Roman alphabet or any other.
2929
*/

src/main/java/com/mapcode/Boundary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* ----------------------------------------------------------------------------------------------
2323
* Package private implementation class. For internal use within the mapcode implementation only.
2424
* ----------------------------------------------------------------------------------------------
25-
* <p/>
25+
*
2626
* This class handles territory rectangles for mapcodes.
2727
*/
2828
class Boundary {
@@ -83,7 +83,7 @@ Boundary extendBoundary(final int latMicroDegExtension, final int lonMicroDegExt
8383
/**
8484
* Check if a point falls within a boundary. Note that the "min" values are inclusive for a boundary and
8585
* the "max" values are exclusive.\
86-
* <p/>
86+
*
8787
* Note: Points at the exact North pole with latitude 90 are never part of a boundary.
8888
*
8989
* @param p Point to check.

src/main/java/com/mapcode/Common.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* ----------------------------------------------------------------------------------------------
2121
* Package private implementation class. For internal use within the Mapcode implementation only.
2222
* ----------------------------------------------------------------------------------------------
23-
* <p/>
23+
*
2424
* This class contains common data structures and methods used by the Mapcode implementation.
2525
*/
2626
class Common {

src/main/java/com/mapcode/Data.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* ----------------------------------------------------------------------------------------------
2323
* Package private implementation class. For internal use within the Mapcode implementation only.
2424
* ----------------------------------------------------------------------------------------------
25-
* <p/>
25+
*
2626
* This class the data class for Mapcode codex items.
2727
*/
2828
class Data {

src/main/java/com/mapcode/DataAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* ----------------------------------------------------------------------------------------------
2828
* Package private implementation class. For internal use within the Mapcode implementation only.
2929
* ----------------------------------------------------------------------------------------------
30-
* <p/>
30+
*
3131
* This class contains the module that reads the Mapcode areas into memory and processes them.
3232
*/
3333
class DataAccess {

src/main/java/com/mapcode/Mapcode.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@
2828
/**
2929
* This class defines a single mapcode encoding result, including the alphanumeric code and the
3030
* territory definition.
31-
* <p/>
31+
*
3232
* On terminology, mapcode territory and mapcode code:
33-
* <p/>
33+
*
3434
* In written form. a mapcode is defined as an alphanumeric code, optionally preceded by a
3535
* territory code.
36-
* <p/>
36+
*
3737
* For example: "NLD 49.4V" is a mapcode, but "49.4V" is a mapcode as well, The latter is called
3838
* a "local" mapcode, because it is not internationally unambiguous unless preceded by a territory
3939
* code.
40-
* <p/>
40+
*
4141
* For "NLD 49.4V" the "NLD"-part is called "the territory" and the "49.4V"-part is called
4242
* "the code" (which are both part of "the mapcode").
43-
* <p/>
43+
*
4444
* This distinction between "territory" and "code" in a mapcode is why the interface of this class
4545
* has been changed from version 1.50.0 to reflect this terminology.
46-
* <p/>
46+
*
4747
* On alphabets:
48-
* <p/>
48+
*
4949
* Mapcode codes can be represented in different alphabets. Note that an alphabet is something else
5050
* than a locale or a language. The supported alphabets for mapcodes are listed in {@link Alphabet}.
51-
* <p/>
51+
*
5252
* Mapcode objects provide methods to obtain the mapcode code in a specific alphabet. By default,
5353
* the {@link Alphabet#ROMAN} is used.
5454
*/
@@ -63,10 +63,10 @@ public final class Mapcode {
6363
/**
6464
* Create a mapcode object. Normally, mapcodes are created be encoding a lat/lon pair
6565
* using {@link MapcodeCodec#encode(double, double)} rather than creating them yourself.
66-
* <p/>
66+
*
6767
* Note that it is possible to create invalid mapcodes this way, which are syntactically
6868
* correct.
69-
* <p/>
69+
*
7070
* Note that the constructor will throw an {@link IllegalArgumentException} if the syntax of the mapcode
7171
* is not correct. The mapcode is not checked for validity, other than its syntax.
7272
*
@@ -116,7 +116,7 @@ else if (extensionLength > 8) {
116116
/**
117117
* Get the Mapcode string (without territory information) with standard precision.
118118
* The returned mapcode does not include the '-' separator and additional digits.
119-
* <p/>
119+
*
120120
* A mapcode defines an area of approximately 10 x 10 meters (100 m2) and will decode
121121
* to the center of that area. On average, the original coordinate will be 3.6 meters
122122
* from this center: the average inaccuracy of a mapcode.
@@ -137,15 +137,15 @@ public String getCode() {
137137
/**
138138
* Get the mapcode code (without territory information) with a specified precision.
139139
* The returned mapcode includes a '-' separator and additional digits for precisions 1 to 8.
140-
* <p/>
140+
*
141141
* The precision defines the size of a geographical area a single mapcode covers. This means It also defines
142142
* the maximum distance to the location, a (latitude, longitude) pair, that encoded to this mapcode.
143-
* <p/>
143+
*
144144
* Precision 0: area is approx 10 x 10 meters (100 m2); max. distance from original location less than 7.5 meters.
145145
* Precision 1: area is approx 3.33 m2; max. distance from original location less than 1.5 meters.
146146
* Precision 1: area is approx 0.11 m2; max. distance from original location less than 0.4 meters.
147147
* etc. (each level reduces the area by a factor of 30)
148-
* <p/>
148+
*
149149
* The accuracy is slightly better than the figures above, but these figures are safe assumptions.
150150
*
151151
* @param precision Precision. Range: 0..8.
@@ -176,7 +176,7 @@ public String getCode(final int precision) throws IllegalArgumentException {
176176
* Return the full international mapcode, including the full name of the territory and the mapcode code itself.
177177
* The format of the string is:
178178
* full-territory-name cde
179-
* <p/>
179+
*
180180
* Example:
181181
* Netherlands 49.4V (regular code)
182182
* Netherlands 49.4V-K2 (high precision code)
@@ -211,7 +211,7 @@ public String getCodeWithTerritoryFullname() {
211211
* International codes use a territory code "AAA".
212212
* The format of the code is:
213213
* short-territory-name mapcode
214-
* <p/>
214+
*
215215
* Example:
216216
* NLD 49.4V (regular code)
217217
* NLD 49.4V-K2 (high-precision code)
@@ -282,7 +282,7 @@ public Territory getTerritory() {
282282
/**
283283
* This method return the mapcode type, given a mapcode string. If the mapcode string has an invalid
284284
* format, an exception is thrown.
285-
* <p/>
285+
*
286286
* Note that this method only checks the syntactic validity of the mapcode, the string format. It does not
287287
* check if the mapcode is really a valid mapcode representing a position on Earth.
288288
*
@@ -363,7 +363,7 @@ public static boolean containsTerritory(@Nonnull final String mapcode) throws Il
363363
* Get a safe maximum for the distance between a decoded mapcode and its original
364364
* location used for encoding the mapcode. The actual accuracy (resolution) of mapcodes is
365365
* better than this, but these are safe values to use under normal circumstances.
366-
* <p/>
366+
*
367367
* Do not make any other assumptions on these numbers than that mapcodes are never more off
368368
* by this distance.
369369
*

src/main/java/com/mapcode/MapcodeCodec.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* ----------------------------------------------------------------------------------------------
3030
* Mapcode public interface.
3131
* ----------------------------------------------------------------------------------------------
32-
* <p/>
32+
*
3333
* This class is the external Java interface for encoding and decoding mapcodes.
3434
*/
3535
public final class MapcodeCodec {
@@ -47,13 +47,13 @@ private MapcodeCodec() {
4747
/**
4848
* Encode a lat/lon pair to a mapcode with territory information. This produces a non-empty list of mapcode,
4949
* with at the very least 1 mapcodes for the lat/lon, which is the "International" mapcode.
50-
* <p/>
50+
*
5151
* The returned result list will always contain at least 1 mapcode, because every lat/lon pair can be encoded.
52-
* <p/>
52+
*
5353
* The list is ordered in such a way that the last result is the international code. However, you cannot assume
5454
* that the first result is the shortest mapcode. If you want to use the shortest mapcode, use
5555
* {@link #encodeToShortest(double, double, Territory)}.
56-
* <p/>
56+
*
5757
* The international code can be obtained from the list by using: "results.get(results.size() - 1)", or
5858
* you can use {@link #encodeToInternational(double, double)}, which is faster.
5959
*
@@ -78,9 +78,9 @@ public static List<Mapcode> encode(@Nonnull final Point point)
7878
/**
7979
* Encode a lat/lon pair to a mapcode with territory information, for a specific territory. This produces a
8080
* potentially empty list of mapcodes (empty if the lat/lon does not fall within the territory for mapcodes).
81-
* <p/>
81+
*
8282
* The returned result list will always contain at least 1 mapcode, because every lat/lon pair can be encoded.
83-
* <p/>
83+
*
8484
* The list is ordered in such a way that the last result is the international code. However, you cannot assume
8585
* that the first result is the shortest mapcode. If you want to use the shortest mapcode, use
8686
* {@link #encodeToShortest(double, double, Territory)}.
@@ -181,7 +181,7 @@ public static Mapcode encodeToInternational(@Nonnull final Point point)
181181
/**
182182
* Decode a mapcode to a Point. The decoding process may fail for local mapcodes,
183183
* because no territory context is supplied (world-wide).
184-
* <p/>
184+
*
185185
* The accepted format is:
186186
* {mapcode}
187187
* {territory-code} {mapcode}
@@ -202,11 +202,11 @@ public static Point decode(@Nonnull final String mapcode)
202202

203203
/**
204204
* Decode a mapcode to a Point. A reference territory is supplied for disambiguation (only used if applicable).
205-
* <p/>
205+
*
206206
* The accepted format is:
207207
* {mapcode}
208208
* {territory-code} {mapcode}
209-
* <p/>
209+
*
210210
* Note that if a territory-code is supplied in the string, it takes preferences over the parameter.
211211
*
212212
* @param mapcode Mapcode.

src/main/java/com/mapcode/Point.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
/**
2626
* This class defines a class for lat/lon points.
27-
* <p/>
27+
*
2828
* Internally, the class implements a fixed-point representation where a coordinate is expressed in
2929
* "fractions", of 1/3.240,000,000,000th of a degree. A double (an IEEE 754-1985 binary64) is just
3030
* sufficient to represent coordinates between -180 and +180 degrees in such fractions.
@@ -49,7 +49,7 @@ public class Point {
4949
public static final double EARTH_CIRCUMFERENCE_Y = EARTH_RADIUS_Y_METERS * 2.0 * Math.PI;
5050

5151
// Meters per degree latitude is fixed. For longitude: use factor * cos(midpoint of two degree latitudes).
52-
public static final double METERS_PER_DEGREE_LAT = EARTH_CIRCUMFERENCE_Y / 360.0;
52+
public static final double METERS_PER_DEGREE_LAT = EARTH_CIRCUMFERENCE_Y / 360.0;
5353
public static final double METERS_PER_DEGREE_LON_EQUATOR = EARTH_CIRCUMFERENCE_X / 360.0; // * cos(deg(lat)).
5454

5555
/**
@@ -66,6 +66,10 @@ public static Point fromDeg(final double latDeg, final double lonDeg) {
6666

6767
/**
6868
* Public construction, from integer microdegrees (no loss of precision).
69+
*
70+
* @param latMicroDeg Latitude, in microdegrees.
71+
* @param lonMicroDeg Longitude, in microdegrees.
72+
* @return A defined point.
6973
*/
7074
@Nonnull
7175
public static Point fromMicroDeg(final int latMicroDeg, final int lonMicroDeg) {
@@ -168,8 +172,7 @@ public static double distanceInMeters(@Nonnull final Point p1, @Nonnull final Po
168172
if (p1.getLonDeg() <= p2.getLonDeg()) {
169173
from = p1;
170174
to = p2;
171-
}
172-
else {
175+
} else {
173176
from = p2;
174177
to = p1;
175178
}
@@ -225,10 +228,10 @@ public boolean equals(final Object obj) {
225228
}
226229
final Point that = (Point) obj;
227230
return (this.latMicroDeg == that.latMicroDeg) &&
228-
(this.lonMicroDeg == that.lonMicroDeg) &&
229-
(this.latFractionOnlyDeg == that.latFractionOnlyDeg) &&
230-
(this.lonFractionOnlyDeg == that.lonFractionOnlyDeg) &&
231-
(this.defined == that.defined);
231+
(this.lonMicroDeg == that.lonMicroDeg) &&
232+
(this.latFractionOnlyDeg == that.latFractionOnlyDeg) &&
233+
(this.lonFractionOnlyDeg == that.lonFractionOnlyDeg) &&
234+
(this.defined == that.defined);
232235
}
233236

234237
/**
@@ -237,12 +240,12 @@ public boolean equals(final Object obj) {
237240
* -----------------------------------------------------------------------
238241
*/
239242
// Constants to convert between Degrees, MicroDegrees and Fractions
240-
static final double MICRODEG_TO_DEG_FACTOR = 1000000.0;
241-
static final double MAX_PRECISION_FACTOR = 810000.0;
243+
static final double MICRODEG_TO_DEG_FACTOR = 1000000.0;
244+
static final double MAX_PRECISION_FACTOR = 810000.0;
242245
static final double LAT_MICRODEG_TO_FRACTIONS_FACTOR = MAX_PRECISION_FACTOR;
243246
static final double LON_MICRODEG_TO_FRACTIONS_FACTOR = MAX_PRECISION_FACTOR * 4;
244-
static final double LAT_TO_FRACTIONS_FACTOR = MICRODEG_TO_DEG_FACTOR * LAT_MICRODEG_TO_FRACTIONS_FACTOR;
245-
static final double LON_TO_FRACTIONS_FACTOR = MICRODEG_TO_DEG_FACTOR * LON_MICRODEG_TO_FRACTIONS_FACTOR;
247+
static final double LAT_TO_FRACTIONS_FACTOR = MICRODEG_TO_DEG_FACTOR * LAT_MICRODEG_TO_FRACTIONS_FACTOR;
248+
static final double LON_TO_FRACTIONS_FACTOR = MICRODEG_TO_DEG_FACTOR * LON_MICRODEG_TO_FRACTIONS_FACTOR;
246249

247250
private int latMicroDeg; // Whole nr of MICRODEG_TO_DEG_FACTOR.
248251
private int lonMicroDeg; // Whole nr of MICRODEG_TO_DEG_FACTOR.
@@ -272,8 +275,7 @@ private Point(final double latDeg, final double lonDeg) {
272275
double lat = latDeg + 90;
273276
if (lat < 0) {
274277
lat = 0;
275-
}
276-
else if (lat > 180) {
278+
} else if (lat > 180) {
277279
lat = 180;
278280
}
279281

@@ -367,8 +369,7 @@ Point wrap() {
367369
lonMicroDeg %= 360000000;
368370
if (lonMicroDeg >= 180000000) {
369371
lonMicroDeg -= 360000000;
370-
}
371-
else if (lonMicroDeg < -180000000) {
372+
} else if (lonMicroDeg < -180000000) {
372373
lonMicroDeg += 360000000;
373374
}
374375
}

src/main/java/com/mapcode/Territory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* ----------------------------------------------------------------------------------------------
2727
* Mapcode public interface.
2828
* ----------------------------------------------------------------------------------------------
29-
* <p/>
29+
*
3030
* This class defines the available territory codes as used by mapcode.
3131
*/
3232
public enum Territory {
@@ -654,13 +654,13 @@ static Territory fromNumber(final int number) throws UnknownTerritoryException {
654654
* Get a territory from a mapcode territory abbreviation (or a territory name). Note that the provided abbreviation is NOT an
655655
* ISO code: it's a mapcode prefix. As local mapcodes for subdivisions have been optimized to prefer to use 2-character
656656
* subdivisions codes in local codes, subdivisions are preferred over countries in this case.
657-
* <p/>
657+
*
658658
* For example, fromString("AS") returns {@link Territory#IN_AS} rather than {@link Territory#ASM} and
659659
* fromString("BR") returns {@link Territory#IN_BR} rather than {@link Territory#BRA}.
660-
* <p/>
660+
*
661661
* This behavior is intentional as local mapcodes are designed to be as short as possible. A mapcode within
662662
* the Indian state Bihar should therefore be able to specified as "BR 49.46M3" rather "IN-BR 49.46M3".
663-
* <p/>
663+
*
664664
* Brazilian mapcodes, on the other hand, would be specified as "BRA BDHP.JK39-1D", using the ISO 3 letter code.
665665
*
666666
* @param alphaCode Territory name or alphanumeric code.

src/main/java/com/mapcode/UnknownMapcodeException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/**
2222
* This checked exception is thrown for invalid mapcodes (which have the right syntax, are correctly formatted).
23-
* <p/>
23+
*
2424
* Note that for syntactically incorrect mapcodes, normally {@link IllegalArgumentException}s are thrown,
2525
* not {@link UnknownMapcodeException}.
2626
*/

0 commit comments

Comments
 (0)