Skip to content

Commit 989186d

Browse files
committed
Clean up
1 parent 4c5c9c3 commit 989186d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private Common() {
9393
* @param maxY Longitude.
9494
* @return Divider.
9595
*/
96-
// TODO: Need better names for minY and maxY
96+
// TODO: Need better names for minY and maxY.
9797
static int xDivider(final int minY, final int maxY) {
9898
assert minY < maxY;
9999
if (minY >= 0) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int getTerritoryRecordType(final int territoryRecord) {
6868
return (DATA_MODEL.getDataFlags(territoryRecord) >> 7) & 3; // 1=pipe 2=plus 3=star
6969
}
7070

71-
// TODO: What does "restricted" mean?
71+
// TODO: Explain what "restricted" means.
7272
static boolean isRestricted(final int territoryRecord) {
7373
assert (0 <= territoryRecord) && (territoryRecord < DATA_MODEL.getNrTerritoryRecords());
7474
return (DATA_MODEL.getDataFlags(territoryRecord) & 512) != 0;

src/main/java/com/mapcode/Decoder.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,14 @@ static MapcodeZone decodeToMapcodeZone(@Nonnull final String argMapcode,
6060
}
6161
assert !mapcode.contains("-");
6262

63-
// TODO: What does AEU unpack do?
63+
// TODO: Explain what AEU unpack does.
6464
mapcode = aeuUnpack(mapcode).trim();
6565
if (mapcode.isEmpty()) {
6666
// TODO: Is this a useful log message?
6767
LOG.debug("decode: Failed to aeuUnpack {}", argMapcode);
6868
throw new UnknownMapcodeException("Failed to AEU unpack, mapcode=" + argMapcode + ", territory=" + argTerritory);
6969
}
7070

71-
// TODO: What does incodexlen mean?
7271
final int codexLen = mapcode.length() - 1;
7372

7473
// *** long codes in states are handled by the country

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ public static Rectangle decodeToRectangle(@Nonnull final String mapcode, @Nullab
273273
}
274274

275275

276+
// TODO: Explain when this method is needed/used.
276277
/**
277278
* Is coordinate near multiple territory borders?
278279
*
@@ -282,7 +283,6 @@ public static Rectangle decodeToRectangle(@Nonnull final String mapcode, @Nullab
282283
*/
283284
public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull final Territory territory) {
284285
checkDefined("point", point);
285-
// TODO: This description is not clear enough. When do you use this exactly?
286286
if (territory != Territory.AAA) {
287287
final int territoryNumber = territory.getNumber();
288288
if (territory.getParentTerritory() != null) {

src/main/java/com/mapcode/MapcodeZone.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
* ----------------------------------------------------------------------------------------------
2525
* Simple class to represent all the coordinates that would deliver a particular mapcode.
2626
*/
27-
// TODO: Is a mapcode zone always a rectangle? Is the smallest rectangle around 1 mapcode, or something else?
28-
// TODO: Why is it called MapcodeZone and not for example MapcodeBoundary?
2927
class MapcodeZone {
3028

3129
// TODO: Explain why you need these fractions and how they work exactly.
@@ -106,7 +104,7 @@ boolean isEmpty() {
106104
return ((lonFractionMax <= lonFractionMin) || (latFractionMax <= latFractionMin));
107105
}
108106

109-
// TODO: What does this return?
107+
// TODO: Explain what this is (geo point of mapcode).
110108
@Nonnull
111109
Point getCenter() {
112110
if (isEmpty()) {
@@ -118,7 +116,7 @@ Point getCenter() {
118116
}
119117
}
120118

121-
// TODO: Explain when this is used. Does it clip a mapcode zon after it was retrieved?
119+
// TODO: Explain when this is used. It clips a zone to an encompassing boundary.
122120
// Returns a non-empty intersection of a mapcode zone and a territory area.
123121
// Returns null if no such intersection exists.
124122
@Nonnull

src/site/markdown/ReleaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ These are the release notes for the Java library for mapcodes.
44

55
### 2.4.4
66

7+
* Added calls to decode an international or territorial mapcode to its encompassing
8+
rectangle using `decodeToRectangle`.
9+
710
* Minor code hygiene improvements.
811

912
### 2.4.3

0 commit comments

Comments
 (0)