Package es.situm.sdk.model.directions
Class Indication
java.lang.Object
es.situm.sdk.model.directions.Indication
- All Implemented Interfaces:
android.os.Parcelable,MapperInterface
Represents the instruction that a user should follow when on a
RouteStep to continue
the route-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the main action of the indicationstatic classstatic enumDefines the change in orientation associated the the indication -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Indicationstatic final android.os.Parcelable.Creator<Indication>static final Indicationstatic final IndicationFields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, ASSET_TRACKING_OPTIONS_BEACON_FILTERS, ASSET_TRACKING_OPTIONS_ENABLED, ASSET_TRACKING_OPTIONS_ITERATIONS_TO_UPLOAD, ASSET_TRACKING_OPTIONS_SCANNING_INTERVAL, BEACON_FILTER_UUID, BEARING, BEARING_FROM, BEARING_QUALITY, BOUNDS, BOUNDS_ROTATED, BUILDING, BUILDING_IDENTIFIER, BUILDING_NAME, CARTESIAN_BEARING, CARTESIAN_COORDINATE, CENTER, CLOSEST_LOCATION_IN_ROUTE, CODE, CONVERSION, COORDINATE, CREATED_AT, CURRENT_INDICATION, CURRENT_STEP_INDEX, CUSTOM_FIELDS, dateFormat, DEGREES, DEGREES_CLOCKWISE, DEVICE_ID, DIAGNOSTICS_OPTIONS_UPLOAD_DIAGNOSTICS_DATA, DIMENSIONS, DISTANCE, DISTANCE_TO_CHANGE_FLOOR_THRESHOLD, DISTANCE_TO_CHANGE_INDICATION_THRESHOLD, DISTANCE_TO_CLOSEST_POINT_IN_ROUTE, DISTANCE_TO_END_STEP, DISTANCE_TO_GOAL, DISTANCE_TO_GOAL_THRESHOLD, DISTANCE_TO_IGNORE_FIRST_INDICATION, DISTANCE_TO_NEXT_LEVEL, DURATION_MINUTES, EDGES, EVENTS, EXCLUDED_TAGS, EXTERNAL_NAVIGATION_PAYLOAD, EXTERNAL_NAVIGATION_TYPE, FIRST_STEP, FLOOR, FLOOR_IDENTIFIER, FLOORS, FOREGROUND_SERVICE_NOTIFICATION_MESSAGE, FOREGROUND_SERVICE_NOTIFICATION_SHOW_STOP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_STOP_ACTION_TEXT, FOREGROUND_SERVICE_NOTIFICATION_TAP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_TITLE, FROM, GEOFENCES, HAS_BEARING, HAS_CARTESIAN_BEARING, HEIGHT, HUMAN_READABLE_MESSAGE, ID, IDENTIFIER, IGNORE_LOW_QUALITY_LOCATIONS, INCLUDED_TAGS, INDICATION_TYPE, INDICATIONS, INDICATIONS_INTERVAL, INDOOR_POIS, INFO_HTML, IS_FIRST, IS_INDOOR, IS_LAST, IS_OUTDOOR, IS_PUBLIC, LAST_STEP, LATITUDE, LONGITUDE, MAP_URL, MINIMIZE_FLOOR_CHANGES, NAME, NEEDED_LEVEL_CHANGE, NEXT_INDICATION, NEXT_LEVEL, NODES, NORTH_EAST, NORTH_WEST, ORIENTATION, ORIENTATION_TYPE, OUTDOOR_BUILDING_DETECTOR_BLE, OUTDOOR_POIS, OUTSIDE_ROUTE_THRESHOLD, PICTURE_THUMB_URL, PICTURE_URL, POI_CATEGORIES, POI_CATEGORY, POI_CATEGORY_CODE, POI_CATEGORY_ICON_SELECTED, POI_CATEGORY_ICON_UNSELECTED, POI_CATEGORY_IDENTIFIER, POI_CATEGORY_IDENTIFIERS, POI_CATEGORY_iNAME, POI_CATEGORY_NAME, POI_NAME, POI_TO, POI_TO_IDENTIFIER, POINTS, POLYGON_POINTS, POSITION, PROVIDER, QUALITY, RADIANS, RADIANS_MINUS_PI_PI, RADIUS, REALTIME_UPDATE_INTERVAL, ROTATION, ROUND_INDICATIONS_STEP, ROUTE, ROUTE_STEP, SCALE, SEGMENTS, SOUTH_EAST, SOUTH_WEST, STATUS_NAME, STATUS_ORDINAL, STEP_IDX_DESTINATION, STEP_IDX_ORIGIN, STEPS, TIME_TO_END_STEP, TIME_TO_FIRST_INDICATION, TIME_TO_GOAL, TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES, TIMESTAMP, TO, TO_LEGACY, TRIGGER, UPDATED_AT, USER_IDENTIFIER, WIDTH, X, YFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionIndication(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
Modifier and TypeMethodDescriptionchunk(Indication indication2) Constructs a newIndicationform the current one and the provided indication2.intbooleanstatic IndicationdoubleRetrieve the distance between the origin and destinationintRetrieve the number of levels between the origin and destinationRetrieve theIndication.Actionof the instructionRetrieves the next leveldoubleRetrieve the angle a user should change his direction in order to go from the origin to the destination.Retrieve theIndication.Orientationof the instructionintRetrieve the index of the indication's step of destination.intRetrieve the index of the indication's step of origininthashCode()booleanisChunckableWith(Indication indication2) Checks if thisIndicationcan be combined with another onebooleanCheck 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) toMap()Method to transform object into Map<String, Object>toString()toText(android.content.Context context) Get a natural language string describing the instruction in the language of theLocaleof the device (if translation available).Get a natural language string describing the instruction.voidwriteToParcel(android.os.Parcel dest, int flags)
-
Field Details
-
EMPTY
-
END
-
CALCULATING
-
CREATOR
-
-
Constructor Details
-
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 Details
-
toMap
Description copied from interface:MapperInterfaceMethod to transform object into Map<String, Object>- Specified by:
toMapin interfaceMapperInterface- Returns:
- Map<String, Object> with the information of the object mapped
-
fromMap
- Throws:
IllegalArgumentException
-
setOrientation
public void setOrientation(double orientation) -
setDistanceToNextLevel
public void setDistanceToNextLevel(int distanceToNextLevel) -
setStepIdxOrigin
public void setStepIdxOrigin(int stepIdxOrigin) -
toString
-
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
Retrieve theIndication.Actionof the instruction- Returns:
Indication.Action
-
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
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)
-
equals
-
hashCode
public int hashCode() -
isChunckableWith
Checks if thisIndicationcan be combined with another one- Returns:
- boolean
-
chunk
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
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
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
-