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 TypeMethodDescriptionint
addHighway
(Highway highway) Add the specifiedhighway
to the highways collection.getHighway
(int identifier) Returns the highway using the specifiedidentifier
.Gets the highways iteratorint
getIdentifier
(Highway highway) Returns the identifier of the specifiedhighway
, 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 pathremoveHighway
(int identifier) Removes the of the specifiedhighway
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 highwaystart
- the start pointidTo
- the identifier of the ending highwayend
- the end point and required direction from from this point- Returns:
- finded path
- See Also:
-
getHighways
Gets the highways iterator- Returns:
- the highways iterator
-
addHighway
Add the specifiedhighway
to the highways collection.- Parameters:
highway
- - the highway to be added to this matrix- Returns:
- the identifier of the highway to be added
-
removeHighway
Removes the of the specifiedhighway
from highways collection.- Parameters:
identifier
- - the identifier of the highway to be removed- Returns:
- the highway that was removed from the matrix
-
getHighway
Returns the highway using the specifiedidentifier
.- 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
Returns the identifier of the specifiedhighway
, 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 isnull
-