Reserves a <CODE>Cell</CODE> in the <CODE>Row</CODE>.

@param   column  the column that has to be reserved.
@param   size    the number of columns
@return  <CODE>true</CODE> if the column was reserved, <CODE>false</CODE> if not.
502881
boolean reserve(int column, int size) {
        if ((column < 0) || ((column + size) > columns)) throw new IndexOutOfBoundsException("reserve - incorrect column/size");
        
        for(int i=column; i < column + size; i++)
        {
            if (reserved[i]) {
                // undo reserve
                for(int j=i; j >= column; j--) {
                    reserved[j] = false;
                }
                return false;
            }
            reserved[i] = true;
        }
        return true;
    }
1076092
public TerminalSize withColumns(int columns) {
        if(this.columns == columns) {
            return this;
        }
        if(columns == 0 && this.rows == 0) {
            return ZERO;
        }
        return new TerminalSize(columns, this.rows);
    }
526048
public boolean hasColumnName(String columnName) {
		for (FieldType fieldType : fieldTypes) {
			if (fieldType.getColumnName().equals(columnName)) {
				return true;
			}
		}
		return false;
	}
12405
public void deleteColumn(int column) throws BadElementException {
        float newWidths[] = new float[--columns];
        System.arraycopy(widths, 0, newWidths, 0, column);
        System.arraycopy(widths, column + 1, newWidths, column, columns - column);
        setWidths(newWidths);
        System.arraycopy(widths, 0, newWidths, 0, columns);
        widths = newWidths;
        Row row;
        int size = rows.size();
        for (int i = 0; i < size; i++) {
            row = (Row) rows.get(i);
            row.deleteColumn(column);
            rows.set(i, row);
        }
        if (column == columns) {
            curPosition.setLocation(curPosition.x+1, 0);
        }
    }
1285613
void setSize(int size) {
        if (this.size != 0) {
            final String fmt = "column size is known: %d";
            final String msg = format(fmt, this.size);
            throw new IllegalStateException(msg);
        }
        this.size = size;
        this.hash = hash();
    }
385204
public Record keep(String column) {
		if (getColumns().containsKey(column)) {	// prevent put null value to the newColumns
			Object keepIt = getColumns().get(column);
			getColumns().clear();
			getColumns().put(column, keepIt);
		}
		else
			getColumns().clear();
		return this;
	}
1206150
public function setMaxColumns($columns, $size = null)
    {
        if (is_null($size)) {
            $size = $this->baseSize;
        }
        $columnAttribute = 'max' . ucfirst($size) . 'Columns';
        $this->{$columnAttribute} = $columns;
    }
849706
@Override
	public synchronized Table<String> setSize(TerminalSize size) {
		setVisibleRows(size.getRows() - 1);
		return super.setSize(size);
	}
98090
public Rectangle getCellRect(int row, int column, boolean includeSpacing) {
		Rectangle r = new Rectangle();
		boolean valid = true;
		if (row < 0) {
			// y = height = 0;
			valid = false;
		} else if (row >= getRowCount()) {
			r.y = getHeight();
			valid = false;
		} else {
			r.height = getRowHeight(row);
			// r.y = (getRowModel() == null) ? row * r.height :
			// getRowModel().getPosition(row);
			r.y = row * r.height;
		}

		if (column < 0) {
			if (!getComponentOrientation().isLeftToRight()) {
				r.x = getWidth();
			}
			// otherwise, x = width = 0;
			valid = false;
		} else if (column >= getColumnCount()) {
			if (getComponentOrientation().isLeftToRight()) {
				r.x = getWidth();
			}
			// otherwise, x = width = 0;
			valid = false;
		} else {
			TableColumnModel64 cm = getColumnModel64();
			if (getComponentOrientation().isLeftToRight()) {
				for (int i = 0; i < column; i++) {
					r.x += cm.getColumnWidth(i);
				}
			} else {
				for (int i = cm.getColumnCount() - 1; i > column; i--) {
					r.x += cm.getColumnWidth(i);
				}
			}
			r.width = cm.getColumnWidth(column);
		}

		if (valid && !includeSpacing) {
			// Bound the margins by their associated dimensions to prevent
			// returning bounds with negative dimensions.
			int rm = Math.min(getRowMargin(), r.height);
			int cm = Math.min(getColumnModel().getColumnMargin(), r.width);
			// This is not the same as grow(), it rounds differently.
			r.setBounds(r.x + cm / 2, r.y + rm / 2, r.width - cm, r.height - rm);
		}
		return r;
	}
513906
public CellFinder startPosition(final int column, final int row) {
        ArgUtils.notMin(column, 0, "column");
        ArgUtils.notMin(row, 0, "row");
        
        this.startColumn = column;
        this.startRow = row;
        
        return this;
    }
710715
@Override
	public boolean isCellEditable(final int row, final int column) {
		final int index = table.convertColumnIndexToView(column);
		return table.isEnabled() && table.getColumnModel().getColumn(index).getCellEditor() != null;
	}
604841
public void addColumn(String column) {

        m_columns.add(new CmsSimpleQueryFragment(column, Collections.<Object> emptyList()));
    }
263113
public boolean hasColumns(Collection<String> columns) {
        return columns != null && this.columns.equals(new TreeSet<String>(columns));
    }
103674
public function column(string $name, int $type, int $size = 0): bool
    {
        list($type, $size) = $this->validateColumn($type, $size);
        $this->columns[] = [$name, [$type, $size]];
        return true;
    }
897286
public void updateColumn(int c, TableColumn col)
    {
        int r = 0;
        while (r < getRowCount())
        {
            TableCellBox cell = cells[c][r];
            if (cell != null)
            {
            	cell.setOwnerColumn(col);
                //minimal width
                int min = cell.getMinimalWidth() / cell.getColspan();
                if (min > col.getMinimalWidth())
                    col.setMinimalWidth(min);
                //maximal width
                int max = cell.getMaximalWidth() / cell.getColspan();
                if (max > col.getMaximalWidth())
                    col.setMaximalWidth(max);
                //fixed width and percentages
                if (cell.wset) 
                {
                    col.wset = true;
                    if (cell.isRelative())
                    {
                        col.setRelative(true);
                        if (col.percent < cell.percent)
                            col.percent = cell.percent;
                    }
                    else
                    {
                        if (cell.getContentWidth() > col.abswidth)
                            col.abswidth = cell.getContentWidth();
                    }
                }
                //ensure the minimal width
                if (col.getWidth() < col.getMinimalWidth())
                    col.setColumnWidth(col.getMinimalWidth());
                r += cell.getRowspan();
            }
            else
                r++;
        }
    }
298152
public Cell<C,T> size (Value<C,T> width, Value<C,T> height) {
		minWidth = width;
		minHeight = height;
		prefWidth = width;
		prefHeight = height;
		maxWidth = width;
		maxHeight = height;
		return this;
	}
32085
public void setRow(final KeyValue column) {
    //This api will be called only with the KeyValues from rollup table, as per
    //the scan logic
    if (key != null) {
      throw new IllegalStateException("setRow was already called on " + this);
    }
    
    key = column.key();
    
    //Check whether the cell is generated by same rollup aggregator
    if (need_count) {
      System.out.println("AGG ID: " + agg_id + "  COUNT ID: " + count_id + "  MASK: " + (column.qualifier()[0] & RollupUtils.AGGREGATOR_MASK));
      if ((column.qualifier()[0] & RollupUtils.AGGREGATOR_MASK) == agg_id) {
        append(column, false, false);
      } else if ((column.qualifier()[0] & RollupUtils.AGGREGATOR_MASK) == count_id) {
        append(column, true, false);
      // OLD style for Yahoo!
      } else if (Bytes.memcmp(RollupQuery.SUM, column.qualifier(), 0, RollupQuery.SUM.length) == 0) {
        append(column, false, true);
      } else if (Bytes.memcmp(RollupQuery.COUNT, column.qualifier(), 0, RollupQuery.COUNT.length) == 0) {
        append(column, true, true);
      } else {
        throw new IllegalDataException("Attempt to add a different aggrregate cell ="
            + column + ", expected aggregator either SUM or COUNT");
      }
    } else {
      if ((column.qualifier()[0] & RollupUtils.AGGREGATOR_MASK) == agg_id) {
        append(column, false, false);
      } else if (Bytes.memcmp(column.qualifier(), rollup_query.getRollupAggPrefix(), 0,
            rollup_query.getRollupAggPrefix().length) == 0) {
        append(column, false, true);
      } else {
        throw new IllegalDataException("Attempt to add a different aggrregate cell ="
            + column + ", expected aggregator " + Bytes.pretty(
            rollup_query.getRollupAggPrefix()));
      }
    }
  }