Search this API

y.layout.router.polyline
Class Path

java.lang.Object
  extended by y.layout.router.polyline.Path

public class Path
extends java.lang.Object

A Path represents the result of a path search as a list of consecutive CellEntrances. A path starts with a CellEntrance for a PartitionCell of the source node and ends with one for a PartitionCell of the target node.

See Also:
PathSearch, PathSearchResult
 

Constructor Summary
Path(java.util.List entrances, double cost)
          Creates a new instance of Path for the given edge, cell entrances and cost.
 
Method Summary
 double getCost()
          Returns the overall cost of this path.
 CellEntrance getEntrance(int position)
          Returns the CellEntrance at the given position of this path.
 int length()
          Returns the number of CellEntrance objects in this path.
 int positionOf(CellEntrance entrance)
          Returns the position of the first occurrence of the given CellEntrance in this path, or -1 if this path does not contain this CellEntrance.
 void setEntrance(int position, CellEntrance entrance)
          Replaces the CellEntrance at the given position of this path with the given CellEntrance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Path

public Path(java.util.List entrances,
            double cost)
Creates a new instance of Path for the given edge, cell entrances and cost.

Parameters:
entrances - the list of CellEntrance objects describing the edge path from source node to target node
cost - the overall cost of this path
Method Detail

getCost

public double getCost()
Returns the overall cost of this path.

Returns:
the overall cost of this path

getEntrance

public CellEntrance getEntrance(int position)
Returns the CellEntrance at the given position of this path.

Parameters:
position - the position of the CellEntrance to return
Returns:
the CellEntrance at the given position of this path
See Also:
setEntrance(int, CellEntrance)

setEntrance

public void setEntrance(int position,
                        CellEntrance entrance)
Replaces the CellEntrance at the given position of this path with the given CellEntrance.

Parameters:
position - the position of the CellEntrance to replace
entrance - the CellEntrance to be stored at the given position
See Also:
getEntrance(int)

positionOf

public int positionOf(CellEntrance entrance)
Returns the position of the first occurrence of the given CellEntrance in this path, or -1 if this path does not contain this CellEntrance.

Parameters:
entrance - the CellEntrance for which the position is retrieved
Returns:
the position of the first occurrence of the given CellEntrance in this path, or -1 if this path does not contain this CellEntrance

length

public int length()
Returns the number of CellEntrance objects in this path.

Returns:
the number of CellEntrance objects in this path

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.