Skip to content

Commit a5af010

Browse files
committed
Use single-line JavaDoc comments where possible.
1 parent 49aeb46 commit a5af010

File tree

4 files changed

+18
-49
lines changed

4 files changed

+18
-49
lines changed

java/com/google/openlocationcode/OpenLocationCode.java

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
import java.util.Map;
66

77
/**
8-
* Representation of open location code.
9-
* https://github.com/google/open-location-code
10-
* The OpenLocationCode class is a wrapper around String value {@code code}, which guarantees that
11-
* the value is a valid Open Location Code.
8+
* Representation of open location code. https://github.com/google/open-location-code The
9+
* OpenLocationCode class is a wrapper around String value {@code code}, which guarantees that the
10+
* value is a valid Open Location Code.
1211
*
1312
* @author Jiri Semecky
1413
*/
@@ -38,9 +37,7 @@ public class OpenLocationCode {
3837
private static final char SEPARATOR_POSITION = 8;
3938
private static final char SUFFIX_PADDING = '0';
4039

41-
/**
42-
* Class providing information about area covered by Open Location Code.
43-
*/
40+
/** Class providing information about area covered by Open Location Code. */
4441
public class CodeArea {
4542

4643
private final BigDecimal southLatitude;
@@ -93,14 +90,10 @@ public double getEastLongitude() {
9390
}
9491

9592

96-
/**
97-
* The state of the OpenLocationCode.
98-
*/
93+
/** The state of the OpenLocationCode. */
9994
private final String code;
10095

101-
/**
102-
* Creates Open Location Code for the provided code.
103-
*/
96+
/** Creates Open Location Code for the provided code. */
10497
public OpenLocationCode(String code) {
10598
if (!isValidCode(code)) {
10699
throw new IllegalArgumentException(
@@ -109,9 +102,7 @@ public OpenLocationCode(String code) {
109102
this.code = code.toUpperCase();
110103
}
111104

112-
/**
113-
* Creates Open Location Code from the provided latitude, longitude and desired code length.
114-
*/
105+
/** Creates Open Location Code from the provided latitude, longitude and desired code length. */
115106
public OpenLocationCode(double latitude, double longitude, int codeLength)
116107
throws IllegalArgumentException {
117108
if (codeLength < 4 || (codeLength < 10 & codeLength % 2 == 1)) {
@@ -178,9 +169,7 @@ public OpenLocationCode(double latitude, double longitude, int codeLength)
178169
this.code = codeBuilder.toString();
179170
}
180171

181-
/**
182-
* Creates Open Location Code with code length 10 from the provided latitude, longitude.
183-
*/
172+
/** Creates Open Location Code with code length 10 from the provided latitude, longitude. */
184173
public OpenLocationCode(double latitude, double longitude) {
185174
this(latitude, longitude, 10);
186175
}
@@ -267,30 +256,22 @@ public static CodeArea decode(String code) throws IllegalArgumentException {
267256
return new OpenLocationCode(code).decode();
268257
}
269258

270-
/**
271-
* Returns whether this {@link OpenLocationCode} is a full Open Location Code.
272-
*/
259+
/** Returns whether this {@link OpenLocationCode} is a full Open Location Code. */
273260
public boolean isFull() {
274261
return code.indexOf(SEPARATOR) == SEPARATOR_POSITION;
275262
}
276263

277-
/**
278-
* Returns whether the provided Open Location Code is a full Open Location Code.
279-
*/
264+
/** Returns whether the provided Open Location Code is a full Open Location Code. */
280265
public static boolean isFull(String code) throws IllegalArgumentException {
281266
return new OpenLocationCode(code).isFull();
282267
}
283268

284-
/**
285-
* Returns whether this {@link OpenLocationCode} is a short Open Location Code.
286-
*/
269+
/** Returns whether this {@link OpenLocationCode} is a short Open Location Code. */
287270
public boolean isShort() {
288271
return code.indexOf(SEPARATOR) >= 0 && code.indexOf(SEPARATOR) < SEPARATOR_POSITION;
289272
}
290273

291-
/**
292-
* Returns whether the provided Open Location Code is a short Open Location Code.
293-
*/
274+
/** Returns whether the provided Open Location Code is a short Open Location Code. */
294275
public static boolean isShort(String code) throws IllegalArgumentException {
295276
return new OpenLocationCode(code).isShort();
296277
}
@@ -423,9 +404,7 @@ public String toString() {
423404

424405
// Exposed static helper methods.
425406

426-
/**
427-
* Returns whether the provided string is a valid Open Location code.
428-
*/
407+
/** Returns whether the provided string is a valid Open Location code. */
429408
public static boolean isValidCode(String code) {
430409
if (code == null || code.length() < 2) {
431410
return false;
@@ -502,9 +481,7 @@ public static boolean isValidCode(String code) {
502481
return true;
503482
}
504483

505-
/**
506-
* Returns if the code is a valid full Open Location Code.
507-
*/
484+
/** Returns if the code is a valid full Open Location Code. */
508485
public static boolean isFullCode(String code) {
509486
try {
510487
return new OpenLocationCode(code).isFull();
@@ -513,9 +490,7 @@ public static boolean isFullCode(String code) {
513490
}
514491
}
515492

516-
/**
517-
* Returns if the code is a valid short Open Location Code.
518-
*/
493+
/** Returns if the code is a valid short Open Location Code. */
519494
public static boolean isShortCode(String code) {
520495
try {
521496
return new OpenLocationCode(code).isShort();

java/com/google/openlocationcode/tests/EncodingTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
import java.util.ArrayList;
1313
import java.util.List;
1414

15-
/**
16-
* Tests encoding and decoding between Open Location Code and latitude/longitude pair.
17-
*/
15+
/** Tests encoding and decoding between Open Location Code and latitude/longitude pair. */
1816
public class EncodingTest {
1917

2018
public static final double PRECISION = 1e-10;

java/com/google/openlocationcode/tests/PrecisionTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import org.junit.Assert;
66
import org.junit.Test;
77

8-
/**
9-
* Tests size of rectangles defined by open location codes of various size.
10-
*/
8+
/** Tests size of rectangles defined by open location codes of various size. */
119
public class PrecisionTest {
1210

1311
@Test

java/com/google/openlocationcode/tests/ShorteningTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
import java.util.ArrayList;
1313
import java.util.List;
1414

15-
/**
16-
* Tests shortening functionality of Open Location Code.
17-
*/
15+
/** Tests shortening functionality of Open Location Code. */
1816
public class ShorteningTest {
1917

2018
private class TestData {

0 commit comments

Comments
 (0)