1 package org.simantics.district.route;
3 import java.util.Collections;
7 * @author Tuukka Lehtonen
9 public interface Route {
11 default String getName() {
12 return "empty"; //$NON-NLS-1$
15 void setName(String name);
17 Waypoint createWaypoint(Object backend);
21 default void addWaypoint(Waypoint r) {
22 addWaypoint(count(), r);
25 default void addWaypoint(int index, Waypoint r) {
26 throw new UnsupportedOperationException();
30 * Removes the specified waypoint from the route
32 default void removeWaypoint(Waypoint r) {
33 throw new UnsupportedOperationException();
37 * @return amount of points in the route
40 return waypoints().size();
43 default List<Waypoint> waypoints() {
44 return Collections.emptyList();
47 // TODO: reorder route points