org.caida.otter
Class Column

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

public class Column
extends java.lang.Object

A column object. A container for rows, which are in turn containers for coordinates.


Field Summary
static int BOUNDING_BOX_DENSITY
           
static int BOUNDING_BOX_MARGIN
           
 
Constructor Summary
Column()
          Create an empty column.
Column(int x)
          Create a column with an x value.
Column(Label newLabel)
          Create a new column and insert a label as the first member
Column(Node newNode)
          Create a new column and insert a node as the first member.
Column(java.lang.String colName)
          Create a column with a name.
 
Method Summary
 void addCoordinate(Coordinate newCoord)
          Add a coordinate.
 void addLabel(Label newLabel)
          Add a label to the column.
 void addNode(Node newNode)
          Add a node to the column.
 void calculateRowColBoundingBoxes(int colNum)
          Calculate the bounding boxes containing all the coordinates in the column and save the results in the boundingBoxes Vector.
 void calculateXYBoundingBoxes()
          Calculate the bounding boxes containing all the coordinates in the column and save the results in the boundingBoxes Vector.
 int countOutboundLinks()
          Count the number of outbound links from the column.
 void debug()
           
 void debugColContents()
          Purge the column contents to the screen
 boolean doesLineCrossBoundingBox(int x1, int y1, int x2, int y2)
          Test a line against the bounding boxes of the column.
 boolean doesLineCrossBoundingBox(Node n1, Node n2)
          Overloaded version of doesLineCrossBoundingBox to accept Nodes
 void finalizeColumn()
          Make sure the column contents contain the right X val.
 Coordinate[] getCoords()
          Return an array of the coords in the column
 java.util.Vector getCoordVect()
          Return the coordinate vector.
 int getLabelCount()
          Return the number of labels in the column.
 java.util.Vector getLabelVect()
          Return the label vector.
 java.lang.String getName()
          Get a column's name
 int getNodeCount()
          Return the number of nodes in the column.
 Node[] getNodes()
          Return the node array.
 java.util.Vector getNodeVect()
          Return the node vector.
 int getXLoc()
          Get the x coordinate of the column.
 void insertHiddenNodes(int colNum, DisplayObjects data)
          Insert hidden nodes within the column for links that are purely vertical.
 boolean isEmpty()
          Check if the column contains any coordinates.
 void removeCoord(Coordinate coord)
          Remove a coordinate from this column
 void setColIdx(int index)
          Set a column's index number.
 void setColumnX(int new_x)
          Set the X val of everything in column
 void setName(java.lang.String colName)
          Set a column's name.
 void setXandYvalues(int rowStart, int rowHeight)
          Explicitly synchronize the x and y values of nodes w/ the row and column they belong to.
 void setXandYvalues(int rowStart, int colPos, int rowHeight)
          Explicitly synchronize the x and y values of nodes w/ the row and column they belong to.
 int shiftColumnX(int offset)
          Shift all the values in a column by the offset.
 void sortNodesByParentMean(int minNodeSpacing, int maxChildSearchDepth)
          Request all rows to sort their nodes by parent mean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOUNDING_BOX_MARGIN

public static final int BOUNDING_BOX_MARGIN

BOUNDING_BOX_DENSITY

public static final int BOUNDING_BOX_DENSITY
Constructor Detail

Column

public Column()
Create an empty column.

Column

public Column(java.lang.String colName)
Create a column with a name.
Parameters:
colName - The name of the new column.

Column

public Column(int x)
Create a column with an x value.
Parameters:
x - The initial x value of the new column.

Column

public Column(Node newNode)
Create a new column and insert a node as the first member.
Parameters:
newNode - The first node to put into the new column.

Column

public Column(Label newLabel)
Create a new column and insert a label as the first member
Parameters:
newLabel - The first label to put into the new column.
Method Detail

getCoords

public Coordinate[] getCoords()
Return an array of the coords in the column

getCoordVect

public java.util.Vector getCoordVect()
Return the coordinate vector.
Returns:
A Vector of the coordinates stored in this Column.

getNodeVect

public java.util.Vector getNodeVect()
Return the node vector.
Returns:
A Vector of the nodes stored in this column.

getNodes

public Node[] getNodes()
Return the node array.
Returns:
An array of the nodes stored in this column.

removeCoord

public void removeCoord(Coordinate coord)
Remove a coordinate from this column
Parameters:
coord - The coordinate to remove from the column.

getLabelVect

public java.util.Vector getLabelVect()
Return the label vector.
Returns:
A vector of the labels found in this column.

setColumnX

public void setColumnX(int new_x)
Set the X val of everything in column
Parameters:
new_x - The X value to set for this column.

finalizeColumn

public void finalizeColumn()
Make sure the column contents contain the right X val.

shiftColumnX

public int shiftColumnX(int offset)
Shift all the values in a column by the offset.
Parameters:
offset - The offset to shift the X value of this column by.

addCoordinate

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

addNode

public void addNode(Node newNode)
Add a node to the column.
Parameters:
newNode - The node to add to the column.

addLabel

public void addLabel(Label newLabel)
Add a label to the column.
Parameters:
newLabel - The label to add to the column.

getXLoc

public int getXLoc()
Get the x coordinate of the column.
Returns:
The X value of this column.

getNodeCount

public int getNodeCount()
Return the number of nodes in the column.
Returns:
The count of nodes in this column.

getLabelCount

public int getLabelCount()
Return the number of labels in the column.
Returns:
the count of labels found in this column.

countOutboundLinks

public int countOutboundLinks()
Count the number of outbound links from the column.
Returns:
the count of outbound links from this column.

calculateRowColBoundingBoxes

public void calculateRowColBoundingBoxes(int colNum)
Calculate the bounding boxes containing all the coordinates in the column and save the results in the boundingBoxes Vector. Each call to this method overwrites previous calculations of the bounding boxes. This version works on columns before they have been spaced out into their final X ( and rows to Y) values. That's why the column number is taken as a parmeter.
Parameters:
colNum - The column number this column is in the ColumnSet.

calculateXYBoundingBoxes

public void calculateXYBoundingBoxes()
Calculate the bounding boxes containing all the coordinates in the column and save the results in the boundingBoxes Vector. Each call to this method overwrites previous calculations of the bounding boxes. This verison is useful after the X (and row Y) values have been set, giving a more accurate representation of the bounding boxes.

doesLineCrossBoundingBox

public boolean doesLineCrossBoundingBox(Node n1,
                                        Node n2)
Overloaded version of doesLineCrossBoundingBox to accept Nodes
Parameters:
n1 - The node representing the "from" coordinate.
n2 - The node representing the "to" coordinate.
Returns:
true if the line intersects this column's bounding box, false otherwise.

doesLineCrossBoundingBox

public boolean doesLineCrossBoundingBox(int x1,
                                        int y1,
                                        int x2,
                                        int y2)
Test a line against the bounding boxes of the column. The parameters represent a line segment from (x1,y1) to (x2,y2).
Returns:
true if the line intersects this column's bounding box, false otherwise.

setXandYvalues

public void setXandYvalues(int rowStart,
                           int colPos,
                           int rowHeight)
Explicitly synchronize the x and y values of nodes w/ the row and column they belong to. Update this columns X value as a side affect.
Parameters:
rowStart - The offset for the first row in the column.
colPos - The x value of the column.
rowHeight - The spacing in between rows.

setXandYvalues

public void setXandYvalues(int rowStart,
                           int rowHeight)
Explicitly synchronize the x and y values of nodes w/ the row and column they belong to. Use this column's x value as the default X value.
Parameters:
rowStart - The offset for the first row.
rowHeight - The spacing in between rows.

setName

public void setName(java.lang.String colName)
Set a column's name.
Parameters:
colName - The column's new name.

getName

public java.lang.String getName()
Get a column's name
Returns:
The column's name.

isEmpty

public boolean isEmpty()
Check if the column contains any coordinates.
Returns:
true if the column is empty, false otherwise.

setColIdx

public void setColIdx(int index)
Set a column's index number.
Parameters:
index - The column's new index number.

sortNodesByParentMean

public void sortNodesByParentMean(int minNodeSpacing,
                                  int maxChildSearchDepth)
Request all rows to sort their nodes by parent mean.
Parameters:
minNodeSpacing - The minimun spacing between nodes, so the amount of space individual nodes are seperated by when spreading a row.

insertHiddenNodes

public void insertHiddenNodes(int colNum,
                              DisplayObjects data)
Insert hidden nodes within the column for links that are purely vertical.
Parameters:
colNum - Our column number

debugColContents

public void debugColContents()
Purge the column contents to the screen

debug

public void debug()