public function addRow($row)
    {
        if (is_array($row)) {
            $cells = array_values($row);
            $row = new Row($cells);
        } elseif ($row instanceof Row) {
            $cells = $row->getCells();
        } else {
            throw new \InvalidArgumentException('Argument supplied to Table::addRow should be an array or an instance of Row.');
        }

        if (count($cells) != count($this->columns)) {
            throw new \InvalidArgumentException('Number of Cells in Row does not match the number of Columns in Table.');
        }

        foreach ($cells as $i => $cell) {
            if ($cell != null && !$this->columns[$i]->getType()->validate($cell)) {
                throw new \InvalidArgumentException('Cell #' . ($i + 1) . ' does not comply with the column definition.');
            }
        }

        $this->rows[] = $row;
    }