Package es.situm.sdk.model.directions
Class Indication
- java.lang.Object
-
- es.situm.sdk.model.directions.Indication
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIndication.ActionDefines the main action of the indicationstatic classIndication.Builderstatic classIndication.OrientationDefines the change in orientation associated the the indication
-
Field Summary
Fields Modifier and Type Field Description static IndicationCALCULATINGstatic android.os.Parcelable.Creator<Indication>CREATORstatic IndicationEMPTYstatic IndicationEND
-
Constructor Summary
Constructors Constructor Description Indication()Indication(int stepIndex, double orientationChange, double distance, int floorDistance)Constructs Indication calculating its GuidanceActionType and GuidanceOrientationTypeIndication(int stepIndex, double orientationChange, double distance, int floorDistance, Integer nextLevel)Constructs Indication calculating its GuidanceActionType and GuidanceOrientationType
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Indicationchunk(Indication indication2)Constructs a newIndicationform the current one and the provided indication2.intdescribeContents()booleanequals(Object o)doublegetDistance()Retrieve the distance between the origin and destinationintgetDistanceToNextLevel()Retrieve the number of levels between the origin and destinationIndication.ActiongetIndicationType()Retrieve theIndication.Actionof the instructionIntegergetNextLevel()Retrieves the next leveldoublegetOrientation()Retrieve the angle a user should change his direction in order to go from the origin to the destination.Indication.OrientationgetOrientationType()Retrieve theIndication.Orientationof the instructionintgetStepIdxDestination()Retrieve the index of the indication's step of destination.intgetStepIdxOrigin()Retrieve the index of the indication's step of origininthashCode()booleanisChunckableWith(Indication indication2)Checks if thisIndicationcan be combined with another onebooleanisNeededLevelChange()Check if the user should change the level in order to arrive to destinationbooleanisValid()Check if a particular guidance make sensevoidsetDistance(double distance)voidsetDistanceToNextLevel(int distanceToNextLevel)voidsetOrientation(double orientation)voidsetStepIdxOrigin(int stepIdxOrigin)StringtoString()StringtoText(android.content.Context context)Get a natural language string describing the instruction in the language of theLocaleof the device (if translation available).StringtoText(android.content.Context context, Locale locale)Get a natural language string describing the instruction.voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY
public static final Indication EMPTY
-
END
public static final Indication END
-
CALCULATING
public static final Indication CALCULATING
-
CREATOR
public static final android.os.Parcelable.Creator<Indication> CREATOR
-
-
Constructor Detail
-
Indication
public Indication(int stepIndex, double orientationChange, double distance, int floorDistance)Constructs Indication calculating its GuidanceActionType and GuidanceOrientationType- Parameters:
stepIndex- index of theRouteStepwhose indication is being calculatedorientationChange- angle in radians of change in orientation to follow the route (-pi,pi)distance- distance of theRouteStepfromRouteStep.getDistance()floorDistance- : Distance between floors of points origin and destination of theRouteStep
-
Indication
public Indication(int stepIndex, double orientationChange, double distance, int floorDistance, Integer nextLevel)Constructs Indication calculating its GuidanceActionType and GuidanceOrientationType- Parameters:
stepIndex- index of theRouteStepwhose indication is being calculatedorientationChange- angle in radians of change in orientation to follow the route (-pi,pi)distance- distance of theRouteStepfromRouteStep.getDistance()floorDistance- : Distance between floors of points origin and destination of theRouteStep
-
Indication
public Indication()
-
-
Method Detail
-
setOrientation
public void setOrientation(double orientation)
-
setDistanceToNextLevel
public void setDistanceToNextLevel(int distanceToNextLevel)
-
setStepIdxOrigin
public void setStepIdxOrigin(int stepIdxOrigin)
-
getOrientation
public double getOrientation()
Retrieve the angle a user should change his direction in order to go from the origin to the destination.- Returns:
- double value (radians)
-
getIndicationType
@NonNull public Indication.Action getIndicationType()
Retrieve theIndication.Actionof the instruction- Returns:
Indication.Action
-
getOrientationType
@NonNull public Indication.Orientation getOrientationType()
Retrieve theIndication.Orientationof the instruction- Returns:
Indication.Orientation
-
getDistance
public double getDistance()
Retrieve the distance between the origin and destination- Returns:
- double value (in meters)
-
isNeededLevelChange
public boolean isNeededLevelChange()
Check if the user should change the level in order to arrive to destination- Returns:
- boolean value
-
getDistanceToNextLevel
public int getDistanceToNextLevel()
Retrieve the number of levels between the origin and destination- Returns:
- integer value representing the number of level to go upstairs (positive values) or downstairs (negative values)
-
getNextLevel
@Nullable public Integer getNextLevel()
Retrieves the next level- Returns:
- String value representing the next level
-
setDistance
public void setDistance(double distance)
-
getStepIdxOrigin
public int getStepIdxOrigin()
Retrieve the index of the indication's step of origin- Returns:
- integer value representing the index of the step of origin
-
getStepIdxDestination
public int getStepIdxDestination()
Retrieve the index of the indication's step of destination. If the indication belongs to only one step, it is the same as the step index of origin.- Returns:
- integer value representing the index of the step of destination
-
isValid
public boolean isValid()
Check if a particular guidance make sense- Returns:
- bolean value determine if the guidance is valid (true) or invalid (false)
-
isChunckableWith
public boolean isChunckableWith(@NonNull Indication indication2)Checks if thisIndicationcan be combined with another one- Returns:
- boolean
-
chunk
@NonNull public Indication chunk(@NonNull Indication indication2)
Constructs a newIndicationform the current one and the provided indication2. It should be check before if they are chunkable with the functionisChunckableWith(Indication)- Returns:
Indicationwith parameters combined
-
toText
public String toText(@NonNull android.content.Context context)
Get a natural language string describing the instruction in the language of theLocaleof the device (if translation available). The default language is english.- Parameters:
context-- Returns:
- String
-
toText
public String toText(@NonNull android.content.Context context, @Nullable Locale locale)
Get a natural language string describing the instruction. If locale available it will return a string in that language. Otherwise it will try the system localeLocale. Finally, if neither of them is available, it will return in the default language (english)- Parameters:
context-locale-Localeof the desired language- Returns:
- String with the textual indication
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
-