245 |
*/ |
*/ |
246 |
public void setColumns (int newCols) |
public void setColumns (int newCols) |
247 |
{ |
{ |
248 |
if (cols < 0) |
if (newCols < 0) |
249 |
throw new IllegalArgumentException ("number of columns cannot be negative"); |
throw new IllegalArgumentException ("number of columns cannot be negative"); |
250 |
if (newCols == 0 && rows == 0) |
if (newCols == 0 && rows == 0) |
251 |
throw new IllegalArgumentException ("number of rows is already 0"); |
throw new IllegalArgumentException ("number of rows is already 0"); |
271 |
*/ |
*/ |
272 |
public void setRows (int newRows) |
public void setRows (int newRows) |
273 |
{ |
{ |
274 |
if (rows < 0) |
if (newRows < 0) |
275 |
throw new IllegalArgumentException ("number of rows cannot be negative"); |
throw new IllegalArgumentException ("number of rows cannot be negative"); |
276 |
if (newRows == 0 && cols == 0) |
if (newRows == 0 && cols == 0) |
277 |
throw new IllegalArgumentException ("number of columns is already 0"); |
throw new IllegalArgumentException ("number of columns is already 0"); |