public class Instruction extends Object
| Modifier and Type | Field and Description |
|---|---|
protected InstructionAnnotation |
annotation |
static int |
CONTINUE_ON_STREET |
protected double |
distance |
protected Map<String,Object> |
extraInfo |
static int |
FINISH |
static int |
IGNORE |
static int |
KEEP_LEFT |
static int |
KEEP_RIGHT |
static int |
LEAVE_ROUNDABOUT |
protected String |
name |
protected PointList |
points |
static int |
PT_END_TRIP |
static int |
PT_START_TRIP |
static int |
PT_TRANSFER |
protected boolean |
rawName |
static int |
REACHED_VIA |
protected int |
sign |
protected long |
time |
static int |
TURN_LEFT |
static int |
TURN_RIGHT |
static int |
TURN_SHARP_LEFT |
static int |
TURN_SHARP_RIGHT |
static int |
TURN_SLIGHT_LEFT |
static int |
TURN_SLIGHT_RIGHT |
static int |
U_TURN_LEFT |
static int |
U_TURN_RIGHT |
static int |
U_TURN_UNKNOWN |
static int |
UNKNOWN |
static int |
USE_ROUNDABOUT |
| Constructor and Description |
|---|
Instruction(int sign,
String name,
InstructionAnnotation ia,
PointList pl)
The points, distances and times have exactly the same count.
|
| Modifier and Type | Method and Description |
|---|---|
double |
calcAzimuth(Instruction nextI)
Return the azimuth in degree based on the first tracksegment of this instruction.
|
String |
calcDirection(Instruction nextI)
Return the direction like 'NE' based on the first tracksegment of the instruction.
|
InstructionAnnotation |
getAnnotation() |
double |
getDistance()
Distance in meter until no new instruction
|
Map<String,Object> |
getExtraInfoJSON() |
int |
getLength()
This method returns the length of an Instruction.
|
String |
getName() |
PointList |
getPoints() |
int |
getSign()
The instruction for the person/driver to execute.
|
long |
getTime()
Duration until the next instruction, in milliseconds
|
String |
getTurnDescription(Translation tr) |
Instruction |
setDistance(double distance) |
void |
setExtraInfo(String key,
Object value) |
void |
setName(String name) |
void |
setPoints(PointList points) |
void |
setSign(int sign) |
Instruction |
setTime(long time) |
void |
setUseRawName()
This method does not perform translation or combination with the sign - it just uses the
provided name as instruction.
|
String |
toString() |
public static final int UNKNOWN
public static final int U_TURN_UNKNOWN
public static final int U_TURN_LEFT
public static final int KEEP_LEFT
public static final int LEAVE_ROUNDABOUT
public static final int TURN_SHARP_LEFT
public static final int TURN_LEFT
public static final int TURN_SLIGHT_LEFT
public static final int CONTINUE_ON_STREET
public static final int TURN_SLIGHT_RIGHT
public static final int TURN_RIGHT
public static final int TURN_SHARP_RIGHT
public static final int FINISH
public static final int REACHED_VIA
public static final int USE_ROUNDABOUT
public static final int IGNORE
public static final int KEEP_RIGHT
public static final int U_TURN_RIGHT
public static final int PT_START_TRIP
public static final int PT_TRANSFER
public static final int PT_END_TRIP
protected PointList points
protected final InstructionAnnotation annotation
protected boolean rawName
protected int sign
protected String name
protected double distance
protected long time
public Instruction(int sign,
String name,
InstructionAnnotation ia,
PointList pl)
public void setUseRawName()
public InstructionAnnotation getAnnotation()
public int getSign()
public void setSign(int sign)
public String getName()
public void setName(String name)
public double getDistance()
public Instruction setDistance(double distance)
public long getTime()
public Instruction setTime(long time)
public PointList getPoints()
public void setPoints(PointList points)
public String calcDirection(Instruction nextI)
public double calcAzimuth(Instruction nextI)
public int getLength()
In general this will just resolve to the size of the PointList, except for ViaInstruction and
FinishInstruction, which are only virtual instructions, in a sense that they don't provide
a turn instruction, but only an info ("reached via point or destination").
See #1216 and #1138
public String getTurnDescription(Translation tr)
Copyright © 2012–2019. All rights reserved.