class RectangularViewportDefinition extends ViewportDefinition {

  @Override
  public boolean isValidFor(GridStructure grid) {
    if (!_rows.isEmpty()) {
      int maxRow = _rows.get(_rows.size() - 1);
      if (maxRow >= grid.getRowCount()) {
        return false;
      }
    }
    if (!_columns.isEmpty()) {
      int maxCol = _columns.get(_columns.size() - 1);
      if (maxCol >= grid.getColumnCount()) {
        return false;
      }
    }
    return true;
  }

    RectangularViewportDefinition(int version,
                                              List<Integer> rows,
                                              List<Integer> columns,
                                              TypeFormatter.Format format,
                                              Boolean enableLogging);

}