Class SegmentReference

java.lang.Object
com.here.sdk.routing.SegmentReference

public final class SegmentReference extends Object

Reference to a segment id with a travel direction.

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • Field Details

    • segmentId

      @NonNull public String segmentId

      Topology segment id representing a unique identifier within the HERE platform catalogs.

    • travelDirection

      @NonNull public TravelDirection travelDirection

      Travel direction of the segment.

    • offsetStart

      public double offsetStart

      The start offset is a non-negative number between 0 and 1, representing the start of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

    • offsetEnd

      public double offsetEnd

      The end offset is a non-negative number between 0 and 1, representing the end of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

    • tilePartitionId

      public long tilePartitionId

      HERE tile partition id (Morton-encoding + level indicator) of the segment. As in HERE Map Content.

    • localId

      @Nullable public Long localId

      Local ID of the segment inside the OCM tile.

  • Constructor Details

    • SegmentReference

      public SegmentReference()

      Creates a new instance.

    • SegmentReference

      public SegmentReference(@NonNull String segmentId)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

    • SegmentReference

      public SegmentReference(@NonNull String segmentId, @NonNull TravelDirection travelDirection)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

      travelDirection -

      Travel direction of the segment.

    • SegmentReference

      public SegmentReference(@NonNull String segmentId, @NonNull TravelDirection travelDirection, double offsetStart)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

      travelDirection -

      Travel direction of the segment.

      offsetStart -

      The start offset is a non-negative number between 0 and 1, representing the start of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

    • SegmentReference

      public SegmentReference(@NonNull String segmentId, @NonNull TravelDirection travelDirection, double offsetStart, double offsetEnd)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

      travelDirection -

      Travel direction of the segment.

      offsetStart -

      The start offset is a non-negative number between 0 and 1, representing the start of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

      offsetEnd -

      The end offset is a non-negative number between 0 and 1, representing the end of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

    • SegmentReference

      public SegmentReference(@NonNull String segmentId, @NonNull TravelDirection travelDirection, double offsetStart, double offsetEnd, long tilePartitionId)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

      travelDirection -

      Travel direction of the segment.

      offsetStart -

      The start offset is a non-negative number between 0 and 1, representing the start of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

      offsetEnd -

      The end offset is a non-negative number between 0 and 1, representing the end of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

      tilePartitionId -

      HERE tile partition id (Morton-encoding + level indicator) of the segment. As in HERE Map Content.

    • SegmentReference

      public SegmentReference(@NonNull String segmentId, @NonNull TravelDirection travelDirection, double offsetStart, double offsetEnd, long tilePartitionId, @Nullable Long localId)

      Creates a new instance.

      Parameters:
      segmentId -

      Topology segment id representing a unique identifier within the HERE platform catalogs.

      travelDirection -

      Travel direction of the segment.

      offsetStart -

      The start offset is a non-negative number between 0 and 1, representing the start of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

      offsetEnd -

      The end offset is a non-negative number between 0 and 1, representing the end of the referenced range using a proportion of the length of the segment. 0 represents the start and 1 the end of the segment, relative to the indicated direction (or positive direction in case of undirected segments)

      tilePartitionId -

      HERE tile partition id (Morton-encoding + level indicator) of the segment. As in HERE Map Content.

      localId -

      Local ID of the segment inside the OCM tile.

  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromString

      @Nullable public static SegmentReference fromString(@NonNull String segmentRef)

      Returns an instance of this struct from a string if it's well-formatted, null otherwise.

      Parameters:
      segmentRef -

      The string to parse

      Returns:

      An instance of SegmentReference from a string if it's well-formatted, null otherwise.