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);
19 default void addWaypoint(Waypoint r) {
20 addWaypoint(count(), r);
23 default void addWaypoint(int index, Waypoint r) {
24 throw new UnsupportedOperationException();
28 * Removes the specified waypoint from the route
30 default void removeWaypoint(Waypoint r) {
31 throw new UnsupportedOperationException();
35 * @return amount of points in the route
38 return waypoints().size();
41 default List<Waypoint> waypoints() {
42 return Collections.emptyList();
45 // TODO: reorder route points