package org.simantics.district.route; import java.util.Collections; import java.util.List; /** * @author Tuukka Lehtonen */ public interface Route { default String getName() { return "empty"; //$NON-NLS-1$ } void setName(String name); Waypoint createWaypoint(Object backend); boolean persisted(); default void addWaypoint(Waypoint r) { addWaypoint(count(), r); } default void addWaypoint(int index, Waypoint r) { throw new UnsupportedOperationException(); } /** * Removes the specified waypoint from the route */ default void removeWaypoint(Waypoint r) { throw new UnsupportedOperationException(); } /** * @return amount of points in the route */ default int count() { return waypoints().size(); } default List waypoints() { return Collections.emptyList(); } // TODO: reorder route points }