Search this API

y.layout.router.polyline
Class Path

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

public class Path
extends Object

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

See Also:
PathSearch, PathSearchResult

Constructor Summary
Path(Edge edge, List entrances, double cost)
          Creates a new instance.
 
Method Summary
 double getCost()
          Returns the overall cost of this path.
 Edge getEdge()
          Returns the edge this path was calculated for.
 CellEntrance getEntrance(int position)
          Returns the CellEntrance at the given position of this path.
 int length()
          Returns the count of CellEntrance objects this path consists of.
 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 the 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(Edge edge,
            List entrances,
            double cost)
Creates a new instance.

Parameters:
edge - The edge the path was calculated for.
entrances - A list of CellEntrance objects describing the edge path from source node to target node.
cost - The overall cost of this path.
Method Detail

getEdge

public Edge getEdge()
Returns the edge this path was calculated for.

Returns:
The edge this path was calculated for.

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 - position of the CellEntrance to return
Returns:
the CellEntrance at the given position of this path

setEntrance

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

Parameters:
position - position of the CellEntrance to replace
entrance - CellEntrance to be stored at the given position

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 the CellEntrance.

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

length

public int length()
Returns the count of CellEntrance objects this path consists of.

Returns:
The count of CellEntrance objects this path consists of.

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