public class MapRoute
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CIRCULAR
Type of the route ID: circular (1).
|
static int |
PINGPONG
Type of the route ID: ping-pong (2).
|
| Constructor and Description |
|---|
MapRoute(int type,
java.util.List<MapNode> stops)
Creates a new map route
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNrofStops()
Returns the number of stops on this route
|
java.util.List<MapNode> |
getStops() |
MapNode |
nextStop()
Returns the next stop on the route (depenging on the route mode)
|
static java.util.List<MapRoute> |
readRoutes(java.lang.String fileName,
int type,
SimMap map)
Reads routes from files defined in Settings
|
MapRoute |
replicate()
Returns a new route with the same settings
|
void |
setNextIndex(int index)
Sets the next index for this route
|
java.lang.String |
toString() |
public static final int CIRCULAR
public static final int PINGPONG
public MapRoute(int type,
java.util.List<MapNode> stops)
stops - The stops of this route in a listtype - Type of the route (e.g. CIRCULAR or PINGPONG)public void setNextIndex(int index)
index - The index to setpublic int getNrofStops()
public java.util.List<MapNode> getStops()
public MapNode nextStop()
public MapRoute replicate()
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.util.List<MapRoute> readRoutes(java.lang.String fileName, int type, SimMap map)
fileName - name of the file where to read routestype - Type of the routemap - SimMap where corresponding map nodes are found