Skip to content

Commit edd5b57

Browse files
committed
#66: Add Javadoc.
1 parent cd367fb commit edd5b57

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

jpx/src/main/java/io/jenetics/jpx/geom/Geoid.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -308,36 +308,36 @@ public Length distance(final Point start, final Point end) {
308308
}
309309

310310
/**
311-
* Calculating the speed of point {@code p1} with the given predecessor point
312-
* {@code p0}. {@link Optional#empty()} is returned if the time property of
311+
* Calculating the speed of point {@code b} with the given predecessor point
312+
* {@code a}. {@link Optional#empty()} is returned if the time property of
313313
* one of the given points is <em>empty</em>.
314314
*
315315
* @since !__version__!
316316
*
317-
* @param p0 the start point
318-
* @param p1 the destination
317+
* @param a the start point
318+
* @param b the destination
319319
* @return the calculated (average) speed between the two given points
320320
* @throws NullPointerException if one of the points is {@code null}
321321
*/
322-
public Optional<Speed> speed(final Point p0, final Point p1) {
323-
return duration(p0, p1)
322+
public Optional<Speed> speed(final Point a, final Point b) {
323+
return duration(a, b)
324324
.map(sec -> Speed.of(
325-
distance(p0, p1).doubleValue()/sec,
325+
distance(a, b).doubleValue()/sec,
326326
Speed.Unit.METERS_PER_SECOND)
327327
);
328328
}
329329

330-
private static Optional<Double> duration(final Point p0, final Point p1) {
331-
return p0.getTime().flatMap(t0 ->
332-
p1.getTime().map(t1 ->
330+
private static Optional<Double> duration(final Point a, final Point b) {
331+
return a.getTime().flatMap(t0 ->
332+
b.getTime().map(t1 ->
333333
minus(t0, t1)/1_000.0
334334
)
335335
);
336336
}
337337

338-
private static long minus(final ZonedDateTime t1, final ZonedDateTime t2) {
339-
final long i1 = t1.toInstant().toEpochMilli();
340-
final long i2 = t2.toInstant().toEpochMilli();
338+
private static long minus(final ZonedDateTime a, final ZonedDateTime b) {
339+
final long i1 = a.toInstant().toEpochMilli();
340+
final long i2 = b.toInstant().toEpochMilli();
341341
return i2 - i1;
342342
}
343343

0 commit comments

Comments
 (0)