public class WaypointEntry
extends java.lang.Object
RouteWaypoint
and adds additional methods.Constructor and Description |
---|
WaypointEntry(int resourceIdLabel)
Constructs a new instance using the given resource id label.
|
WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint)
Constructs a new instance using the given
RouteWaypoint . |
WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint,
int resourceIdLabel)
Constructs a new instance using the given
RouteWaypoint and resource id label. |
WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint,
java.lang.String label)
Constructs a new instance using the given
RouteWaypoint and string label. |
WaypointEntry(java.lang.String label)
Constructs a new instance using the given string label.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLabel(android.content.Context context,
java.lang.String defaultValue)
Gets label to be shown for this instance.
|
int |
getResourceIdLabel()
Gets the resource string id associated with this instance.
|
com.here.android.mpa.routing.RouteWaypoint |
getRouteWaypoint()
Gets the
RouteWaypoint associated with this instance. |
java.lang.String |
getStringLabel()
Gets the string label associated with this instance.
|
boolean |
isDraggable()
Indicates whether this instance is draggable when used as an element of a
WaypointList . |
boolean |
isRemovable()
Indicates whether this instance is removable when used as an element of a
WaypointList . |
boolean |
isValid()
Indicates whether this instance contains a valid coordinate.
|
WaypointEntry |
setDraggable(boolean draggable)
Sets this instance to be draggable when used as an element of a
WaypointList . |
WaypointEntry |
setRemovable(boolean removable)
Sets this instance to be removable when used as an element of a
WaypointList . |
WaypointEntry |
setResourceIdLabel(int stringId)
Sets the resource id label to this instance.
|
WaypointEntry |
setRouteWaypoint(com.here.android.mpa.routing.RouteWaypoint routeWaypoint)
Sets the
RouteWaypoint for this instance. |
WaypointEntry |
setStringLabel(java.lang.String label)
Sets the string label to this instance.
|
public WaypointEntry(java.lang.String label)
Note that this does not set a default GeoCoordinate
.
label
- the text to show in the WaypointList
.public WaypointEntry(@StringRes int resourceIdLabel)
(int)
Note that this does not set a default GeoCoordinate
.
resourceIdLabel
- the resource id of a string to show in the WaypointList
.public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint)
RouteWaypoint
.waypoint
- the RouteWaypoint
to set. If no label is provided, the coordinates will be shown
in the WaypointList
.public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint, java.lang.String label)
RouteWaypoint
and string label.waypoint
- RouteWaypoint
.label
- the label to show or null if the coordinates should be shown instead.public WaypointEntry(com.here.android.mpa.routing.RouteWaypoint waypoint, @StringRes int resourceIdLabel)
RouteWaypoint
and resource id label.
For more information about resource id label see (int)
waypoint
- RouteWaypoint
.resourceIdLabel
- the resource id of a string to show or 0 if the coordinates should be shown instead.@Nullable public java.lang.String getStringLabel()
public WaypointEntry setStringLabel(java.lang.String label)
label
- a string label for this entry.@StringRes public int getResourceIdLabel()
public WaypointEntry setResourceIdLabel(@StringRes int stringId)
getLabel(Context, String)
.stringId
- a resource string id for this entry.public java.lang.String getLabel(@NonNull android.content.Context context, @NonNull java.lang.String defaultValue)
context
- the required Context
.defaultValue
- string that will be returned if string label and resource id label
are invalid.public com.here.android.mpa.routing.RouteWaypoint getRouteWaypoint()
RouteWaypoint
associated with this instance.RouteWaypoint
associated.public WaypointEntry setRouteWaypoint(com.here.android.mpa.routing.RouteWaypoint routeWaypoint)
RouteWaypoint
for this instance.routeWaypoint
- a RouteWaypoint
instance.public boolean isValid()
RouteWaypoint
and RouteWaypoint.getOriginalPosition()
is not null, false otherwise.public boolean isDraggable()
WaypointList
.
Default is true.public WaypointEntry setDraggable(boolean draggable)
WaypointList
.draggable
- true if item should be draggable, false otherwise.public boolean isRemovable()
WaypointList
.
Default is true.public WaypointEntry setRemovable(boolean removable)
WaypointList
.removable
- true if item should be removable, false otherwise.