|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmovement.map.MapRoute
public class MapRoute
A route that consists of map nodes. There can be different kind of routes and the type is determined by the type parameter (1 or 2).
| Field Summary | |
|---|---|
static int |
CIRCULAR
Type of the route ID: circular (1). |
static int |
PINGPONG
Type of the route ID: ping-pong (2). |
| Constructor Summary | |
|---|---|
MapRoute(int type,
java.util.List<MapNode> stops)
Creates a new map route |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CIRCULAR
public static final int PINGPONG
| Constructor Detail |
|---|
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)| Method Detail |
|---|
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.Object
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||