/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics.example.tsp.gpx;

import java.time.ZonedDateTime;
import java.util.Optional;

/**
 * A geographic point with optional elevation and time.
 *
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @version !__version__!
 * @since !__version__!
 */
public interface Point {

	/**
	 * The latitude of the point, WGS84 datum.
	 *
	 * @return the latitude of the point
	 */
	public Latitude getLatitude();

	/**
	 * The longitude of the point, WGS84 datum.
	 *
	 * @return the longitude of the point
	 */
	public Longitude getLongitude();

	/**
	 * The elevation (in meters) of the point.
	 *
	 * @return the elevation (in meters) of the point
	 */
	public Optional<Length> getElevation();

	/**
	 * Creation/modification timestamp for the point.
	 *
	 * @return creation/modification timestamp for the point
	 */
	public Optional<ZonedDateTime> getTime();

	/**
	 * Return the distance between {@code this} and the {@code other}
	 * {@code WayPoint}.
	 *
	 * @param other the second way-point
	 * @return the distance between {@code this} and the {@code other}
	 * {@code WayPoint}
	 * @throws NullPointerException if the {@code other} way-point is {@code null}
	 */
	public default Length distance(final Point other) {
		return Points.distance(this, other);
	}
}

@@ -1429,32 +1429,40 @@
 nt%0A%09 */%0A%09public 
+default 
 Optional%3CLength%3E
@@ -1476,17 +1476,48 @@
 vation()
-;
+ %7B%0A%09%09return Optional.empty();%0A%09%7D
 %0A%0A%09/**%0A%09
@@ -1641,16 +1641,24 @@
 %09public 
+default 
 Optional
@@ -1682,17 +1682,48 @@
 etTime()
-;
+ %7B%0A%09%09return Optional.empty();%0A%09%7D
 %0A%0A%09/**%0A%09
@@ -1729,14 +1729,17 @@
 %09 * 
-Return
+Calculate
  the
@@ -1760,101 +1760,417 @@
 een 
-%7B@code this%7D and the %7B@code other%7D%0A%09 * %7B@code WayPoint%7D.%0A%09 *%0A%09 * @param other the second way-
+points on an ellipsoidal earth model.%0A%09 *%0A%09 * @see %3Ca href=%22http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf%22%3EDIRECT AND%0A%09 *               INVERSE SOLUTIONS OF GEODESICS 0 THE ELLIPSOID%0A%09 *               WITH APPLICATION OF NESTED EQUATIONS%3C/a%3E%0A%09 * @see %3Ca href=%22http://www.movable-type.co.uk/scripts/latlong-vincenty.html%22%3E%0A%09 *     Vincenty solutions of geodesics on the ellipsoid%3C/a%3E%0A%09 *%0A%09 * @param end the end 
 poin
@@ -2225,46 +2225,29 @@
 and 
-the 
 %7B@code 
-other%7D%0A%09 * %7B@code WayPoint%7D
+end%7D in meters
 %0A%09 *
@@ -2294,19 +2294,13 @@
 ode 
-other%7D way-
+end%7D 
 poin
@@ -2366,21 +2366,19 @@
 l Point 
-other
+end
 ) %7B%0A%09%09re
@@ -2408,17 +2408,16 @@
 is, 
-other
+end
 );%0A%09%7D%0A
+%0A
 %7D%0A

Implement 'Point' default methods.