# Class RatioColumn

java.lang.Object
net.sf.statcvs.reportmodel.Column
net.sf.statcvs.reportmodel.RatioColumn

public class RatioColumn extends Column
A column showing the ratio between two `IntegerColumn`s. The two columns do not have to be shown in the table.

Version:
  $Id: RatioColumn.java,v 1.2 2008/04/02 11:22:14 benoitx Exp $
Author:
  Richard Cyganiak invalid input: '<'rcyg@gmx.de>

## Constructor Summary

Constructors
Constructor
Description
`RatioColumn(String title, IntegerColumn col1, IntegerColumn col2)`
Creates a new `RatioColumn`, which contains the ratio between col1 and col2

## Method Summary

Modifier and Type
Method
Description
`int`
`getRows()`
Return number of rows that have been added to this column
`void`
`renderCell(int rowIndex, TableCellRenderer renderer)`
Renders a row of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods
`void`
`renderHead(TableCellRenderer renderer)`
Renders the head of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods
`void`
`renderTotal(TableCellRenderer renderer)`
Renders the footer of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RatioColumn

public RatioColumn(String title, IntegerColumn col1, IntegerColumn col2)
Creates a new `RatioColumn`, which contains the ratio between col1 and col2

Parameters:
  `title` - the title for the column
  `col1` - the first column
  `col2` - the second column

## Method Details

### getRows

public int getRows()
Description copied from class: `Column`
Return number of rows that have been added to this column

Specified by:
  `getRows` in class `Column`
Returns:
  number of rows that have been added to this column
See Also:
  - `Column.getRows()`

### renderHead

public void renderHead(TableCellRenderer renderer)
Description copied from class: `Column`
Renders the head of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods

Specified by:
  `renderHead` in class `Column`
Parameters:
  `renderer` - the TableCellRenderer to use TODO: this is probably unnecessary; better add a getTitle method
See Also:
  - `Column.renderHead(net.sf.statcvs.renderer.TableCellRenderer)`

### renderCell

public void renderCell(int rowIndex, TableCellRenderer renderer)
Description copied from class: `Column`
Renders a row of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods

Specified by:
  `renderCell` in class `Column`
Parameters:
  `rowIndex` - the row number, starting at 0
  `renderer` - the TableCellRenderer to use
See Also:
  - `Column.renderCell(int, TableCellRenderer)`

### renderTotal

public void renderTotal(TableCellRenderer renderer)
Description copied from class: `Column`
Renders the footer of the column into a `TableCellRenderer` by calling one of its `TableCellRenderer.renderCell(String)` methods. The footer usually contains some kind of total for the column.

Specified by:
  `renderTotal` in class `Column`
Parameters:
  `renderer` - the TableCellRenderer to use
See Also:
  - `Column.renderTotal(net.sf.statcvs.renderer.TableCellRenderer)`