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  view GridFactory download GridFactory.java

java.lang.Object
  extended bycom.port80.graph.dot.impl.GridFactory

public class GridFactory
extends java.lang.Object

Grid factory for vertices in a given VirtualGraph. This class provide methods to create and manipulate Grid objects for the given VirtualGraph. To avoid allocation of lots of Grid object that are used only for a short time. The Grid factory maintains a pool of allocated Grid objects.


Nested Class Summary
(package private)  class GridFactory.GridIterator
          Iterate over Grids in a rank.
(package private) static class GridFactory.ValidXIterator
          ValidXIterator find all the valid x-coordinates that a Grid point can be created for each rank.
 
Field Summary
private static int CAPACITY
           
private static boolean CHECK
           
private static boolean DEBUG
           
private  int fCELL_DISTFACTOR
           
(package private)  VirtualVertex fDest
           
private  int fESpacing
           
(package private)  VirtualGraph fGraph
           
(package private)  Grid[][] fGridTable
          Created grids in each rank.
private  int fHalfESpacing
           
private static int fMAXSIZE
           
(package private)  int fMaxX
           
(package private)  Grid[] fPool
           
(package private)  int fSize
           
(package private)  int[][] fSpaceTable
          Space map.
(package private)  Grid fSpare
           
(package private)  VirtualVertex fSrc
           
private  int fStep
           
(package private)  com.port80.util.struct.IntList[] fValidXTable
          Valid X coordinates in each rank.
private  int fVVWidth
           
private  int fXDIV_EDGES
           
private  int fXDIV_XEDGE
           
private  int fXESpacing
           
private static java.lang.String NAME
           
 
Constructor Summary
(package private) GridFactory()
           
  GridFactory(VirtualGraph graph, int griddiv)
           
 
Method Summary
 void clear()
           
 Grid get()
          Get an uninitialized Grid from allocated pool.
 Grid get(VirtualVertex v)
          Get an initialized vertex Grid.
 int getMaxSize()
           
(package private)  int[][] getSpaceTable()
           
private  void growTo(int n)
           
 void initGrid(VirtualVertex src, VirtualVertex dest)
          Find all the grid points given the source and destination vertex.
(package private)  void initSpaceTable()
           
 int leftBorder(VirtualVertex v)
           
(package private)  void moveVertex(VirtualVertex v, int from, int to)
          Adjust SpaceTable orders when vertex has moved from index 'from' to 'to'.
 int rightBorder(VirtualVertex v)
           
 boolean sanityCheck()
          Check integerity of data structures.
 int size()
           
 void unget(Grid a)
          Unfornately, since Grid object are put into the fGridTable once it is created, it would be expensive to unget the Grid object.
 void updateSpaceTable(VirtualVertex v)
          Update space table values for the given vertex in case vertex.x is changed.
 
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

CHECK

private static boolean CHECK

CAPACITY

private static final int CAPACITY
See Also:
Constant Field Values

fMAXSIZE

private static int fMAXSIZE

fGraph

VirtualGraph fGraph

fPool

Grid[] fPool

fSpare

Grid fSpare

fSize

int fSize

fSpaceTable

int[][] fSpaceTable
Space map. [0, left0, right0, left1, right1,..., maxx] for each rank.


fValidXTable

com.port80.util.struct.IntList[] fValidXTable
Valid X coordinates in each rank. x0,x1, ...


fGridTable

Grid[][] fGridTable
Created grids in each rank.


fMaxX

int fMaxX

fSrc

VirtualVertex fSrc

fDest

VirtualVertex fDest

fXDIV_EDGES

private int fXDIV_EDGES

fXDIV_XEDGE

private int fXDIV_XEDGE

fCELL_DISTFACTOR

private int fCELL_DISTFACTOR

fXESpacing

private int fXESpacing

fESpacing

private int fESpacing

fHalfESpacing

private int fHalfESpacing

fVVWidth

private int fVVWidth

fStep

private int fStep
Constructor Detail

GridFactory

GridFactory()

GridFactory

public GridFactory(VirtualGraph graph,
                   int griddiv)
Method Detail

initSpaceTable

void initSpaceTable()

leftBorder

public int leftBorder(VirtualVertex v)

rightBorder

public int rightBorder(VirtualVertex v)

initGrid

public void initGrid(VirtualVertex src,
                     VirtualVertex dest)
Find all the grid points given the source and destination vertex.


updateSpaceTable

public void updateSpaceTable(VirtualVertex v)
Update space table values for the given vertex in case vertex.x is changed.


moveVertex

void moveVertex(VirtualVertex v,
                int from,
                int to)
Adjust SpaceTable orders when vertex has moved from index 'from' to 'to'.


getSpaceTable

int[][] getSpaceTable()

get

public Grid get()
Get an uninitialized Grid from allocated pool.


get

public Grid get(VirtualVertex v)
Get an initialized vertex Grid.


unget

public void unget(Grid a)
Unfornately, since Grid object are put into the fGridTable once it is created, it would be expensive to unget the Grid object.


size

public int size()

getMaxSize

public int getMaxSize()

clear

public void clear()

growTo

private void growTo(int n)

sanityCheck

public boolean sanityCheck()
Check integerity of data structures.
  • Check that vertices are inside the left and right bounds specified in the fSpaceTable.