Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.graph.dot.impl
Class GridFactory.ValidXIterator  view GridFactory.ValidXIterator download GridFactory.ValidXIterator.java

java.lang.Object
  extended bycom.port80.graph.dot.impl.GridFactory.ValidXIterator
Enclosing class:
GridFactory

static final class GridFactory.ValidXIterator
extends java.lang.Object

ValidXIterator find all the valid x-coordinates that a Grid point can be created for each rank. Grid objects are not created since only a fraction of the valid x-coordinates would be used depend on the path cost. GridIterator is responsible for creating and maintaining Grid objects.


Field Summary
private static boolean DEBUG
           
(package private)  int fErasedIndex
           
(package private)  int fESpacing
           
(package private)  int[] fForced
           
(package private)  int fHalfESpacing
           
(package private)  int fMaxX
           
(package private)  int fOffset
           
(package private)  int fPrevX
           
(package private)  int[] fSpaces
           
(package private)  int fStep
           
(package private)  int fX
           
private static java.lang.String NAME
           
 
Constructor Summary
(package private) GridFactory.ValidXIterator(int[] spaces, int[] forced, int erasedindex, int srcx, int espacing, int step)
           
 
Method Summary
(package private)  int first()
           
(package private)  boolean fitBetween(int left, int right)
           
 int next()
          Get next Grid on the right of the given 'grid'.
(package private)  int nextX()
          Typically just an increment of fESpacing is fine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

fSpaces

int[] fSpaces

fForced

int[] fForced

fErasedIndex

int fErasedIndex

fESpacing

int fESpacing

fStep

int fStep

fX

int fX

fPrevX

int fPrevX

fOffset

int fOffset

fHalfESpacing

int fHalfESpacing

fMaxX

int fMaxX
Constructor Detail

GridFactory.ValidXIterator

GridFactory.ValidXIterator(int[] spaces,
                           int[] forced,
                           int erasedindex,
                           int srcx,
                           int espacing,
                           int step)
Method Detail

first

int first()

next

public int next()
Get next Grid on the right of the given 'grid'.


nextX

int nextX()
Typically just an increment of fESpacing is fine. However, extra efforts are spent to have a Grid point at the source and destination x-coordinates so that straight routes from/to them are possible. To ensure vertically straight routes, grids are preferred to align vertically. To do that, we try to align to a basic grid of fESpacing away from src on both sides. Since each route only cross a rank once, there are no limit on spacing between Grid points themselves as long as they have enough spacings from non-erased vertices. So we simply add a Grid point if iterator go over the src and dest vertices.


fitBetween

boolean fitBetween(int left,
                   int right)