org.caida.otter
Class Row

java.lang.Object
  |
  +--org.caida.otter.Row

public class Row
extends java.lang.Object


Constructor Summary
Row()
          Create an empty row
Row(Coordinate newCoord)
          Create a row and initialize it with this coordinate
Row(int y_val)
          Create an empty row with this y val
 
Method Summary
 void addCoordinate(Coordinate newCoord)
          Add a coordinate to the row
 boolean containsCoord(Coordinate coord)
          Test a row if it contains the specified coordinate.
 boolean containsCoord(java.lang.String name)
          Test a row if it contains the specified coordinate.
 void debug()
           
 int getCoordCount()
          Get a count of all the coordinate in the row.
 java.util.Vector getCoordVect()
          Get a vector of all the coordinates contained by the row.
 int getLabelCount()
          Get a count of the number of labels in the row.
 int getNodeCount()
          Get a count of the number of nodes in the row.
 java.util.Vector getNodeVect()
          Get a vector of the nodes in the row.
 int getYLoc()
          Get a row's y location.
 boolean isEmpty()
          Test if the row is empty
 boolean removeCoord(Coordinate coord)
          Remove the specified coordinate
 boolean removeCoord(java.lang.String name)
          Remove the specified coordinate
 void setColIdx(int index)
          Set a all the nodes to the specified column index
 void setRow(int y_val)
          Set the y value of a row.
 void setRowX(int x_val)
          Necessary because rows are subserviant to Columns.
 void setXandYvalues(int xVal, int yVal)
          Explicitly sync all the x's and y's of the coordinates in the row
 void shiftRow(int y_shift)
          Shift a row's y value by a constant.
 void shiftRowX(int x_shift)
          Necessary because rows are subserviant to Columns.
 void sortNodesByParentMean(int minNodeSpacing, int maxChildSearchDepth)
          Sort a vector of coordinate by their parent (and child) mean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Row

public Row()
Create an empty row

Row

public Row(int y_val)
Create an empty row with this y val

Row

public Row(Coordinate newCoord)
Create a row and initialize it with this coordinate
Parameters:
newCoord - The first coordinate to populate the row.
Method Detail

addCoordinate

public void addCoordinate(Coordinate newCoord)
Add a coordinate to the row
Parameters:
newCoord - The coordinate to add to this row.

setRow

public void setRow(int y_val)
Set the y value of a row. All coordinates in the row are also immediately assigned this y value.
Parameters:
y_val - The Y value of this row, which will be stored as a class variable.

setRowX

public void setRowX(int x_val)
Necessary because rows are subserviant to Columns. All nodes are set to this X value, but the x value is not stored, this is the problem of the column that owns this row.
Parameters:
x_val - The x value to assign to all the coordinates in the row.

shiftRow

public void shiftRow(int y_shift)
Shift a row's y value by a constant. Update all coordinates in the row, as well as update the class variable.
Parameters:
y_shift - The amount to shift the y value of the row.

shiftRowX

public void shiftRowX(int x_shift)
Necessary because rows are subserviant to Columns. Update all coordinates.
Parameters:
x_shift - The amount to shift all coordinates in the column.

getYLoc

public int getYLoc()
Get a row's y location.
Returns:
The y value of the row.

getCoordVect

public java.util.Vector getCoordVect()
Get a vector of all the coordinates contained by the row.
Returns:
The class Vector of all coordinates in the row. Changes made to this vector are changes made to this row.

getNodeVect

public java.util.Vector getNodeVect()
Get a vector of the nodes in the row.
Returns:
A Vector of all the nodes in the row. This Vector is a copy of the class variable, but coordinates to the coordinates are permanent

getNodeCount

public int getNodeCount()
Get a count of the number of nodes in the row.
Returns:
The number of nodes in the row.

getLabelCount

public int getLabelCount()
Get a count of the number of labels in the row.
Returns:
The number of labels in the row.

getCoordCount

public int getCoordCount()
Get a count of all the coordinate in the row.
Returns:
The number of coordinates in the row.

containsCoord

public boolean containsCoord(Coordinate coord)
Test a row if it contains the specified coordinate.
Parameters:
coord - The coordinate to test if it is in the row.
Returns:
true if the coordinate is in the column, false otherwise.

containsCoord

public boolean containsCoord(java.lang.String name)
Test a row if it contains the specified coordinate.
Parameters:
name - The name of a coordinate to test if its in the row.
Returns:
true if a coordinate by the given name was found in the row, false otherwise.

removeCoord

public boolean removeCoord(java.lang.String name)
Remove the specified coordinate
Parameters:
name - The name of the coordinate to remove.
Returns:
true if the coordinate was removed, false otherwise.

removeCoord

public boolean removeCoord(Coordinate coord)
Remove the specified coordinate
Parameters:
coord - The coordinate to remove.
Returns:
true if the coordinate was removed, false otherwise.

setXandYvalues

public void setXandYvalues(int xVal,
                           int yVal)
Explicitly sync all the x's and y's of the coordinates in the row
Parameters:
xVal - The x value to set all coordinates to.
yVal - The y value to set all coordinates to. This value is also stored in the row's class variable, since it should know its own y value.

isEmpty

public boolean isEmpty()
Test if the row is empty
Returns:
true if there are no coordinates in the row, false otherwise.

setColIdx

public void setColIdx(int index)
Set a all the nodes to the specified column index
Parameters:
index - The new index of this column. It is just written straight to the nodes so we can figure out who they belong to later.

sortNodesByParentMean

public void sortNodesByParentMean(int minNodeSpacing,
                                  int maxChildSearchDepth)
Sort a vector of coordinate by their parent (and child) mean. This method will request a sort of the nodes by the children if the parents result in a tie. After the child sort returns, the keys are presumed in sorted order and the nodes are spaced accordingly.
Parameters:
minNodeSpacing - The spacing added between nodes when they are spaced across the row.

debug

public void debug()