/** * Removes an item from the dataset and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param key the key ({@code null} not permitted). * * @throws IllegalArgumentException if {@code key} is * {@code null}. */ public void remove(Comparable key) { this.data.removeValue(key); fireDatasetChanged(); }
/** * Removes an item from the dataset and sends a {@link DatasetChangeEvent} * to all registered listeners. * * @param key the key (<code>null</code> not permitted). * * @throws IllegalArgumentException if <code>key</code> is * <code>null</code>. */ public void remove(Comparable key) { this.data.removeValue(key); fireDatasetChanged(); }
/** * Removes a column from the table. * * @param columnKey the column key (<code>null</code> not permitted). * * @throws UnknownKeyException if the table does not contain a column with * the specified key. * @throws IllegalArgumentException if <code>columnKey</code> is * <code>null</code>. * * @see #removeColumn(int) * @see #removeRow(Comparable) */ public void removeColumn(Comparable columnKey) { if (columnKey == null) { throw new IllegalArgumentException("Null 'columnKey' argument."); } if (!this.columnKeys.contains(columnKey)) { throw new UnknownKeyException("Unknown key: " + columnKey); } Iterator iterator = this.rows.iterator(); while (iterator.hasNext()) { DefaultKeyedValues rowData = (DefaultKeyedValues) iterator.next(); int index = rowData.getIndex(columnKey); if (index >= 0) { rowData.removeValue(columnKey); } } this.columnKeys.remove(columnKey); }
/** * Removes a value from the collection. * * @param key the item key ({@code null} not permitted). * * @throws IllegalArgumentException if {@code key} is * {@code null}. * @throws UnknownKeyException if {@code key} is not recognised. */ public void removeValue(Comparable key) { int index = getIndex(key); if (index < 0) { throw new UnknownKeyException("The key (" + key + ") is not recognised."); } removeValue(index); }
/** * Removes a column from the table. * * @param columnKey the column key ({@code null} not permitted). * * @throws UnknownKeyException if the table does not contain a column with * the specified key. * @throws IllegalArgumentException if {@code columnKey} is * {@code null}. * * @see #removeColumn(int) * @see #removeRow(Comparable) */ public void removeColumn(Comparable columnKey) { Args.nullNotPermitted(columnKey, "columnKey"); if (!this.columnKeys.contains(columnKey)) { throw new UnknownKeyException("Unknown key: " + columnKey); } Iterator iterator = this.rows.iterator(); while (iterator.hasNext()) { DefaultKeyedValues rowData = (DefaultKeyedValues) iterator.next(); int index = rowData.getIndex(columnKey); if (index >= 0) { rowData.removeValue(columnKey); } } this.columnKeys.remove(columnKey); }
/** * Removes a value from the collection. * * @param key the item key (<code>null</code> not permitted). * * @throws IllegalArgumentException if <code>key</code> is * <code>null</code>. * @throws UnknownKeyException if <code>key</code> is not recognised. */ public void removeValue(Comparable key) { int index = getIndex(key); if (index < 0) { throw new UnknownKeyException("The key (" + key + ") is not recognised."); } removeValue(index); }
int columnIndex = row.getIndex(columnKey); if (columnIndex >= 0) { row.removeValue(columnIndex);
int columnIndex = row.getIndex(columnKey); if (columnIndex >= 0) { row.removeValue(columnIndex);