Search this API

y.layout.router.polyline
Class PathSearchContext

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

public class PathSearchContext
extends java.lang.Object

This class provides context information that is useful for the PathSearch algorithm.

Most notably, the context provides access to the edge that is currently being routed (see getCurrentEdge()).

 

Constructor Summary
protected PathSearchContext(PathSearch pathSearch, PathSearchConfiguration configuration)
          Creates a new instance of PathSearchContext.
 
Method Summary
 void addSourceCell(PartitionCell cell)
          Adds an additional source cell of the current path request if it is not already contained in the list of source cells.
 void addTargetCell(PartitionCell cell)
          Adds an additional target cell of the current path request if it is not already contained in the list of target cells.
 PartitionCell getCombinedSourceCell()
          Returns an artificial partition cell with the size of the bounding box of all source cells of the current path request.
 PartitionCell getCombinedTargetCell()
          Returns an artificial partition cell with the size of the bounding box of all target cells of the current path request.
 PathSearchConfiguration getConfiguration()
          Returns the configuration used for the PathSearch.
 Edge getCurrentEdge()
          Returns the edge that is currently routed.
 EdgeLayoutDescriptor getCurrentEdgeLayoutDescriptor()
          Returns the EdgeLayoutDescriptor for the current edge containing edge specific settings for the path search.
 PathRequest getCurrentRequest()
          Gets the PathRequest that is currently routed.
 EdgeCursor getEdges()
          Returns the EdgeCursor to iterate over the edges that are routed.
 PathSearch getPathSearch()
          Returns the PathSearch that uses this context.
 PathSearchResult getPathSearchResult()
          Returns the results of the PathSearch.
 PartitionCell getSourceCell(int index)
          Returns the source cell with the given index in the list of all cells that are covered by the source of the current path request.
 PartitionCell getTargetCell(int index)
          Returns the target cell with the given index in the list of all cells that are covered by the target of the current path request.
 boolean isSourceCell(PartitionCell cell)
          Determines whether or not the given cell is a source cell of the current path request.
 boolean isTargetCell(PartitionCell cell)
          Determines whether or not the given cell is a target cell of the current path request.
protected  void setCurrentEdge(Edge currentEdge)
          Specifies the edge that is routed.
protected  void setCurrentRequest(PathRequest currentRequest)
          Sets the PathRequest that is currently routed.
protected  void setEdges(EdgeList edges)
          Specifies the edges that shall be routed.
 int sourceCellCount()
          Returns the number of all cells that are covered by the source of the current path request.
 int targetCellCount()
          Returns the number of all cells that are covered by the target of the current path request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathSearchContext

protected PathSearchContext(PathSearch pathSearch,
                            PathSearchConfiguration configuration)
Creates a new instance of PathSearchContext.

Parameters:
pathSearch - the path search that uses this context
configuration - the configuration used for the path search
Method Detail

getPathSearch

public PathSearch getPathSearch()
Returns the PathSearch that uses this context.

Returns:
the path search that uses this context

getConfiguration

public PathSearchConfiguration getConfiguration()
Returns the configuration used for the PathSearch.

Returns:
the configuration used for the path search

getEdges

public EdgeCursor getEdges()
Returns the EdgeCursor to iterate over the edges that are routed.

Returns:
the EdgeCursor to iterate over the edges for which a path is calculated

setEdges

protected void setEdges(EdgeList edges)
Specifies the edges that shall be routed.

Parameters:
edges - the list of edges that shall be routed

getCurrentEdge

public Edge getCurrentEdge()
Returns the edge that is currently routed.

This edge is one of those returned by getEdges().

Returns:
the edge that is currently routed

setCurrentEdge

protected void setCurrentEdge(Edge currentEdge)
Specifies the edge that is routed.

Parameters:
currentEdge - the edge that shall be routed

getCurrentRequest

public PathRequest getCurrentRequest()
Gets the PathRequest that is currently routed.

This request belongs to the current edge.

Returns:
the path request that is currently routed.

setCurrentRequest

protected void setCurrentRequest(PathRequest currentRequest)
Sets the PathRequest that is currently routed.

This request belongs to the current edge.

Parameters:
currentRequest - the path request that shall be routed.

getCurrentEdgeLayoutDescriptor

public EdgeLayoutDescriptor getCurrentEdgeLayoutDescriptor()
Returns the EdgeLayoutDescriptor for the current edge containing edge specific settings for the path search.

Returns:
the descriptor for the current edge

sourceCellCount

public int sourceCellCount()
Returns the number of all cells that are covered by the source of the current path request.

Returns:
the number of all cells that are covered by the source

addSourceCell

public void addSourceCell(PartitionCell cell)
Adds an additional source cell of the current path request if it is not already contained in the list of source cells.

Parameters:
cell - the new source cell to add
See Also:
sourceCellCount(), getSourceCell(int)

getSourceCell

public PartitionCell getSourceCell(int index)
Returns the source cell with the given index in the list of all cells that are covered by the source of the current path request.

Parameters:
index - the index of the source cell
Returns:
the source cell with the given index in the list of all source cells

isSourceCell

public boolean isSourceCell(PartitionCell cell)
Determines whether or not the given cell is a source cell of the current path request.

Parameters:
cell - the cell
Returns:
true if the given cell is in the list of source cells, false otherwise
See Also:
sourceCellCount(), getSourceCell(int)

getCombinedSourceCell

public PartitionCell getCombinedSourceCell()
Returns an artificial partition cell with the size of the bounding box of all source cells of the current path request.

Returns:
an artificial partition cell with the size of the bounding box of all source cells
See Also:
getSourceCell(int)

targetCellCount

public int targetCellCount()
Returns the number of all cells that are covered by the target of the current path request.

Returns:
the number of all cells that are covered by the target

addTargetCell

public void addTargetCell(PartitionCell cell)
Adds an additional target cell of the current path request if it is not already contained in the list of target cells.

Parameters:
cell - the new target cell to add
See Also:
targetCellCount(), getTargetCell(int)

getTargetCell

public PartitionCell getTargetCell(int index)
Returns the target cell with the given index in the list of all cells that are covered by the target of the current path request.

Parameters:
index - the index of the target cell
Returns:
the target cell with the given index in the list of all cells that are covered by the target of the current path request

isTargetCell

public boolean isTargetCell(PartitionCell cell)
Determines whether or not the given cell is a target cell of the current path request.

Parameters:
cell - the cell
Returns:
true if the given cell is in the list of target cells, false otherwise
See Also:
targetCellCount(), getTargetCell(int)

getCombinedTargetCell

public PartitionCell getCombinedTargetCell()
Returns an artificial partition cell with the size of the bounding box of all target cells of the current path request.

Returns:
an artificial partition cell with the size of the bounding box of all target cells
See Also:
getTargetCell(int)

getPathSearchResult

public PathSearchResult getPathSearchResult()
Returns the results of the PathSearch.

Returns:
the results of the path search

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