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)
andremoveHighway(int)
methods).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
addHighway(Highway highway)
Add the specifiedhighway
to the highways collection.Highway
getHighway(int identifier)
Returns the highway using the specifiedidentifier
.Iterable<Highway>
getHighways()
Gets the highways iteratorint
getIdentifier(Highway highway)
Returns the identifier of the specifiedhighway
, or -1 if highways collection does not contain the element.RoutePath
getPath(int idFrom, org.eclipse.draw2d.geometry.Point start, int idTo, org.eclipse.draw2d.geometry.Point end)
Finds the pathHighway
removeHighway(int identifier)
Removes the of the specifiedhighway
from highways collection.
-
-
-
Method Detail
-
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:
RoutePath
-
getHighways
Iterable<Highway> getHighways()
Gets the highways iterator- Returns:
- the highways iterator
-
addHighway
int addHighway(Highway highway)
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
Highway removeHighway(int identifier)
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
Highway getHighway(int identifier)
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
int getIdentifier(Highway highway)
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
-
-