]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.route/src/org/simantics/district/route/Route.java
fcd91171eb1c768975da674211428df18c32aaa4
[simantics/district.git] / org.simantics.district.route / src / org / simantics / district / route / Route.java
1 package org.simantics.district.route;
2
3 import java.util.Collections;
4 import java.util.List;
5
6 /**
7  * @author Tuukka Lehtonen
8  */
9 public interface Route {
10
11     default String getName() {
12         return "empty"; //$NON-NLS-1$
13     }
14
15     void setName(String name);
16
17     Waypoint createWaypoint(Object backend);
18
19     default void addWaypoint(Waypoint r) {
20         addWaypoint(count(), r);
21     }
22
23     default void addWaypoint(int index, Waypoint r) {
24         throw new UnsupportedOperationException();
25     }
26
27     /**
28      * Removes the specified waypoint from the route
29      */
30     default void removeWaypoint(Waypoint r) {
31         throw new UnsupportedOperationException();
32     }
33
34     /**
35      * @return amount of points in the route
36      */
37     default int count() {
38         return waypoints().size();
39     }
40
41     default List<Waypoint> waypoints() {
42         return Collections.emptyList();
43     }
44
45     // TODO: reorder route points
46
47 }