!3 Convenient access to table cells.
Sometimes you just want a fixture that lets you access the cells in a table by row and column.  TableFixture provides some simple methods that allow just that.  
 * The (row,column) coordinates are zero based, 
 * with (0,0) being the upper left cell.  

The methods of TableFixture are:

|Comment|
|{{{protected abstract void doStaticTable(int rows)}}}|TableFixture is an abstract class that you must derive from.  You must override ''doStaticTable'' to perform the functions of the fixture.  The number of rows in the table is passed in ''rows''.|
|{{{protected Parse getCell(int row, int column)}}}|Returns the addressed table cell as a ''Parse''.|
|{{{protected String getText(int row, int column)}}}|Returns the text within the addressed table cell.|
|{{{protected boolean blank(int row, int column)}}}|Returns ''true'' if the addressed table cell is blank.|
|{{{protected void wrong(int row, int column)}}}|Turns the addressed table cell red.|
|{{{protected void right(int row, int column)}}}|Turns the addressed table cell green.|
|{{{protected void wrong(int row, int column, String actual)}}}|Turns the addressed table cell red, and annotates it with the ''actuall'' value.|
|{{{protected void ignore(int row, int column)}}}|Turns the addressed cell gray.|
|{{{protected int getInt(int row, int column)}}}|Converts the addressed cell to an int, and returns it.|

As an example of a simple TableFixture, consider ''!-FinalScore-!''.  This simple fixture scores a bowling game.  For example:

|!-eg.bowling.fixtures.FinalScore-!|
|10|10|10|10|10|10|10|10|10|10|10|10||||||||||300|

{{{public class FinalScore extends TableFixture
{
  private BowlingGame game;

  protected void doStaticTable(int rows)
  {
    game = new BowlingGame();
    doRolls();
    doScore();
  }

  private void doRolls()
  {
    for(int i = 0; i < 21; i++)
    {
      if(!blank(0, i))
      {
        int pins = getInt(0, i);
        game.roll(pins);
      }
    }
  }

  private void doScore()
  {
    int expected = getInt(1, 21);
    int actual = game.score(10);
    if(actual == expected)
      right(1, 21);
    else
      wrong(1, 21, "" + actual);
  }
}
}}}

