Package com.graphhopper.util
Class Instruction
java.lang.Object
com.graphhopper.util.Instruction
- Direct Known Subclasses:
FinishInstruction
,RoundaboutInstruction
,ViaInstruction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
protected double
static final int
static final int
static final int
static final int
static final int
protected String
protected PointList
static final int
static final int
static final int
protected boolean
static final int
protected int
protected long
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionInstruction
(int sign, String name, PointList pl) The points, distances and times have exactly the same count. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Distance in meter until no new instructionint
This method returns the length of an Instruction.getName()
int
getSign()
The instruction for the person/driver to execute.long
getTime()
Duration until the next instruction, in millisecondssetDistance
(double distance) void
setExtraInfo
(String key, Object value) void
void
void
setSign
(int sign) setTime
(long time) void
This method does not perform translation or combination with the sign - it just uses the provided name as instruction.toString()
-
Field Details
-
UNKNOWN
public static final int UNKNOWN- See Also:
-
U_TURN_UNKNOWN
public static final int U_TURN_UNKNOWN- See Also:
-
U_TURN_LEFT
public static final int U_TURN_LEFT- See Also:
-
KEEP_LEFT
public static final int KEEP_LEFT- See Also:
-
LEAVE_ROUNDABOUT
public static final int LEAVE_ROUNDABOUT- See Also:
-
TURN_SHARP_LEFT
public static final int TURN_SHARP_LEFT- See Also:
-
TURN_LEFT
public static final int TURN_LEFT- See Also:
-
TURN_SLIGHT_LEFT
public static final int TURN_SLIGHT_LEFT- See Also:
-
CONTINUE_ON_STREET
public static final int CONTINUE_ON_STREET- See Also:
-
TURN_SLIGHT_RIGHT
public static final int TURN_SLIGHT_RIGHT- See Also:
-
TURN_RIGHT
public static final int TURN_RIGHT- See Also:
-
TURN_SHARP_RIGHT
public static final int TURN_SHARP_RIGHT- See Also:
-
FINISH
public static final int FINISH- See Also:
-
REACHED_VIA
public static final int REACHED_VIA- See Also:
-
USE_ROUNDABOUT
public static final int USE_ROUNDABOUT- See Also:
-
IGNORE
public static final int IGNORE- See Also:
-
KEEP_RIGHT
public static final int KEEP_RIGHT- See Also:
-
U_TURN_RIGHT
public static final int U_TURN_RIGHT- See Also:
-
PT_START_TRIP
public static final int PT_START_TRIP- See Also:
-
PT_TRANSFER
public static final int PT_TRANSFER- See Also:
-
PT_END_TRIP
public static final int PT_END_TRIP- See Also:
-
points
-
rawName
protected boolean rawName -
sign
protected int sign -
name
-
distance
protected double distance -
time
protected long time -
extraInfo
-
-
Constructor Details
-
Instruction
The points, distances and times have exactly the same count. The last point of this instruction is not duplicated here and should be in the next one.
-
-
Method Details
-
setUseRawName
public void setUseRawName()This method does not perform translation or combination with the sign - it just uses the provided name as instruction. -
getSign
public int getSign()The instruction for the person/driver to execute. -
setSign
public void setSign(int sign) -
getName
-
setName
-
getExtraInfoJSON
-
setExtraInfo
-
getDistance
public double getDistance()Distance in meter until no new instruction -
setDistance
-
getTime
public long getTime()Duration until the next instruction, in milliseconds -
setTime
-
getPoints
-
setPoints
-
toString
-
getLength
public int getLength()This method returns the length of an Instruction. The length of an instruction is defined by [the index of the first point of the next instruction] - [the index of the first point of this instruction].In general this will just resolve to the size of the PointList, except for
ViaInstruction
andFinishInstruction
, 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
-
getTurnDescription
-