Interface IHighwayMatrix

All Known Implementing Classes:
AbstractHighwayMatrix, HighwayMatrix, HighwayMatrixWave

public interface IHighwayMatrix
Search algorithm of a way from one highway to the another. Contains the collection of the highway. For fast access to this collection of ways identifiers are used.

Depending on implementation, can do intermediate calculations at the time of change of this collection (see addHighway(com._1c.g5.v8.dt.common.gef.drow2d.Highway) and removeHighway(int) methods).

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Add the specified highway to the highways collection.
    getHighway(int identifier)
    Returns the highway using the specified identifier.
    Gets the highways iterator
    int
    Returns the identifier of the specified highway, or -1 if highways collection does not contain the element.
    getPath(int idFrom, org.eclipse.draw2d.geometry.Point start, int idTo, org.eclipse.draw2d.geometry.Point end)
    Finds the path
    removeHighway(int identifier)
    Removes the of the specified highway from highways collection.
  • Method Details

    • getPath

      RoutePath getPath(int idFrom, org.eclipse.draw2d.geometry.Point start, int idTo, org.eclipse.draw2d.geometry.Point end)
      Finds the path
      Parameters:
      idFrom - the identifier of the starting highway
      start - the start point
      idTo - the identifier of the ending highway
      end - the end point and required direction from from this point
      Returns:
      finded path
      See Also:
    • getHighways

      Iterable<Highway> getHighways()
      Gets the highways iterator
      Returns:
      the highways iterator
    • addHighway

      int addHighway(Highway highway)
      Add the specified highway to the highways collection.
      Parameters:
      highway - - the highway to be added to this matrix
      Returns:
      the identifier of the highway to be added
    • removeHighway

      Highway removeHighway(int identifier)
      Removes the of the specified highway from highways collection.
      Parameters:
      identifier - - the identifier of the highway to be removed
      Returns:
      the highway that was removed from the matrix
    • getHighway

      Highway getHighway(int identifier)
      Returns the highway using the specified identifier.
      Parameters:
      identifier - - identifier of the highway to return
      Returns:
      the highway at the specified position in this list
      Throws:
      RuntimeException - in case invalid identifier
    • getIdentifier

      int getIdentifier(Highway highway)
      Returns the identifier of the specified highway, or -1 if highways collection does not contain the element.
      Parameters:
      highway - - element to search for
      Returns:
      the identifier of the specified highway, or -1 if highways collection does not contain the element.
      Throws:
      NullPointerException - if the specified element is null