Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–447 unchanged (447 lines)
448 * @throws IllegalArgumentException if <code>columnKey</code> is
449 * <code>null</code>.
450 *
451 * @see #removeColumn(int)
452 * @see #removeRow(Comparable)
453 */
454 public void removeColumn(Comparable columnKey) {
455 Iterator iterator = this.rows.iterator();
456 while (iterator.hasNext()) {
457 DefaultKeyedValues rowData = (DefaultKeyedValues) iterator.next();
458 rowData.removeValue(columnKey);
459 }
460 this.columnKeys.remove(columnKey);
461 }
462
463 /**
464 * Clears all the data and associated keys.
…lines 465–561 unchanged (97 lines)

After

…lines 1–448 unchanged (448 lines)
449 * <code>null</code>.
450 *
451 * @see #removeColumn(int)
452 * @see #removeRow(Comparable)
453 */
454 public void removeColumn(Comparable columnKey) {
455 if (columnKey == null) {
456 throw new IllegalArgumentException("Null 'columnKey' argument.");
457 }
458 if (!this.columnKeys.contains(columnKey)) {
459 throw new UnknownKeyException("Unknown key: " + columnKey);
460 }
461 Iterator iterator = this.rows.iterator();
462 while (iterator.hasNext()) {
463 DefaultKeyedValues rowData = (DefaultKeyedValues) iterator.next();
464 int index = rowData.getIndex(columnKey);
465 if (index >= 0) {
466 rowData.removeValue(columnKey);
467 }
468 }
469 this.columnKeys.remove(columnKey);
470 }
471
472 /**
473 * Clears all the data and associated keys.
…lines 474–570 unchanged (97 lines)

Before

program
block_comment "/* ========================================================="...
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "data"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "ObjectUtilities"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "PublicCloneable"
; ";"
block_comment "/**\r\n * A data structure that stores zero, one or many value"...
class_declaration
modifiers
public "public"
class "class"
identifier "DefaultKeyedValues2D"
super_interfaces
implements "implements"
type_list
type_identifier "KeyedValues2D"
, ","
type_identifier "PublicCloneable"
, ","
type_identifier "Cloneable"
, ","
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** For serialization. */"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
unary_expression
- "-"
decimal_integer_literal "5514169970951994748L"
; ";"
block_comment "/** The row keys. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "rowKeys"
; ";"
block_comment "/** The column keys. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "columnKeys"
; ";"
block_comment "/** The row data. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "rows"
; ";"
block_comment "/** If the row keys should be sorted by their comparable ord"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "sortRowKeys"
; ";"
block_comment "/**\r\n * Creates a new instance (initially empty).\r\n "...
constructor_declaration
modifiers
public "public"
identifier "DefaultKeyedValues2D"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
this "this"
argument_list
( "("
false "false"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Creates a new instance (initially empty).\r\n "...
constructor_declaration (+82 nodes collapsed)
block_comment "/**\r\n * Returns the row count.\r\n *\r\n * @return T"...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the column count.\r\n *\r\n * @retur"...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the value for a given row and column.\r\n "...
method_declaration (+127 nodes collapsed)
block_comment "/**\r\n * Returns the key for a given row.\r\n *\r\n *"...
method_declaration (+33 nodes collapsed)
block_comment "/**\r\n * Returns the row index for a given key.\r\n *\r\n"...
method_declaration (+86 nodes collapsed)
block_comment "/**\r\n * Returns the row keys in an unmodifiable list.\r\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the key for a given column.\r\n *\r\n "...
method_declaration (+33 nodes collapsed)
block_comment "/**\r\n * Returns the column index for a given key.\r\n "...
method_declaration (+54 nodes collapsed)
block_comment "/**\r\n * Returns the column keys in an unmodifiable list."...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the value for the given row and column k"...
method_declaration (+215 nodes collapsed)
block_comment "/**\r\n * Adds a value to the table. Performs the same fu"...
method_declaration (+35 nodes collapsed)
block_comment "/**\r\n * Adds or updates a value.\r\n *\r\n * @param "...
method_declaration (+225 nodes collapsed)
block_comment "/**\r\n * Removes a value from the table by setting it to "...
method_declaration (+399 nodes collapsed)
block_comment "/**\r\n * Removes a row.\r\n *\r\n * @param rowIndex "...
method_declaration (+41 nodes collapsed)
block_comment "/**\r\n * Removes a row.\r\n *\r\n * @param rowKey th"...
method_declaration (+27 nodes collapsed)
block_comment "/**\r\n * Removes a column.\r\n *\r\n * @param columnI"...
method_declaration (+35 nodes collapsed)
block_comment "/**\r\n * Removes a column from the table.\r\n *\r\n *"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "removeColumn"
formal_parameters
( "("
formal_parameter
type_identifier "Comparable"
identifier "columnKey"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Iterator"
variable_declarator
identifier "iterator"
= "="
method_invocation
field_access
this "this"
. "."
identifier "rows"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
method_invocation
identifier "iterator"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "DefaultKeyedValues"
variable_declarator
identifier "rowData"
= "="
cast_expression
( "("
type_identifier "DefaultKeyedValues"
) ")"
method_invocation
identifier "iterator"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "rowData"
. "."
identifier "removeValue"
argument_list
( "("
identifier "columnKey"
) ")"
; ";"
} "}"
expression_statement
method_invocation
field_access
this "this"
. "."
identifier "columnKeys"
. "."
identifier "remove"
argument_list
( "("
identifier "columnKey"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Clears all the data and associated keys.\r\n *"...
method_declaration (+47 nodes collapsed)
block_comment "/**\r\n * Tests if this object is equal to another.\r\n "...
method_declaration (+344 nodes collapsed)
block_comment "/**\r\n * Returns a hash code.\r\n * \r\n * @return A "...
method_declaration (+79 nodes collapsed)
block_comment "/**\r\n * Returns a clone.\r\n * \r\n * @return A clon"...
method_declaration (+109 nodes collapsed)
} "}"

After

program
block_comment "/* ========================================================="...
package_declaration
package "package"
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "data"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "ObjectUtilities"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "jfree"
. "."
identifier "chart"
. "."
identifier "util"
. "."
identifier "PublicCloneable"
; ";"
block_comment "/**\r\n * A data structure that stores zero, one or many value"...
class_declaration
modifiers
public "public"
class "class"
identifier "DefaultKeyedValues2D"
super_interfaces
implements "implements"
type_list
type_identifier "KeyedValues2D"
, ","
type_identifier "PublicCloneable"
, ","
type_identifier "Cloneable"
, ","
type_identifier "Serializable"
class_body
{ "{"
block_comment "/** For serialization. */"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
unary_expression
- "-"
decimal_integer_literal "5514169970951994748L"
; ";"
block_comment "/** The row keys. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "rowKeys"
; ";"
block_comment "/** The column keys. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "columnKeys"
; ";"
block_comment "/** The row data. */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "rows"
; ";"
block_comment "/** If the row keys should be sorted by their comparable ord"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "sortRowKeys"
; ";"
block_comment "/**\r\n * Creates a new instance (initially empty).\r\n "...
constructor_declaration
modifiers
public "public"
identifier "DefaultKeyedValues2D"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
explicit_constructor_invocation
this "this"
argument_list
( "("
false "false"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Creates a new instance (initially empty).\r\n "...
constructor_declaration (+82 nodes collapsed)
block_comment "/**\r\n * Returns the row count.\r\n *\r\n * @return T"...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the column count.\r\n *\r\n * @retur"...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the value for a given row and column.\r\n "...
method_declaration (+127 nodes collapsed)
block_comment "/**\r\n * Returns the key for a given row.\r\n *\r\n *"...
method_declaration (+33 nodes collapsed)
block_comment "/**\r\n * Returns the row index for a given key.\r\n *\r\n"...
method_declaration (+86 nodes collapsed)
block_comment "/**\r\n * Returns the row keys in an unmodifiable list.\r\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the key for a given column.\r\n *\r\n "...
method_declaration (+33 nodes collapsed)
block_comment "/**\r\n * Returns the column index for a given key.\r\n "...
method_declaration (+54 nodes collapsed)
block_comment "/**\r\n * Returns the column keys in an unmodifiable list."...
method_declaration (+25 nodes collapsed)
block_comment "/**\r\n * Returns the value for the given row and column k"...
method_declaration (+215 nodes collapsed)
block_comment "/**\r\n * Adds a value to the table. Performs the same fu"...
method_declaration (+35 nodes collapsed)
block_comment "/**\r\n * Adds or updates a value.\r\n *\r\n * @param "...
method_declaration (+225 nodes collapsed)
block_comment "/**\r\n * Removes a value from the table by setting it to "...
method_declaration (+399 nodes collapsed)
block_comment "/**\r\n * Removes a row.\r\n *\r\n * @param rowIndex "...
method_declaration (+41 nodes collapsed)
block_comment "/**\r\n * Removes a row.\r\n *\r\n * @param rowKey th"...
method_declaration (+27 nodes collapsed)
block_comment "/**\r\n * Removes a column.\r\n *\r\n * @param columnI"...
method_declaration (+35 nodes collapsed)
block_comment "/**\r\n * Removes a column from the table.\r\n *\r\n *"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "removeColumn"
formal_parameters
( "("
formal_parameter
type_identifier "Comparable"
identifier "columnKey"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "columnKey"
== "=="
null_literal "null"
) ")"
block
{ "{"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "IllegalArgumentException"
argument_list
( "("
string_literal
" "\""
string_fragment "Null 'columnKey' argument."
" "\""
) ")"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
field_access
this "this"
. "."
identifier "columnKeys"
. "."
identifier "contains"
argument_list
( "("
identifier "columnKey"
) ")"
) ")"
block
{ "{"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "UnknownKeyException"
argument_list
( "("
binary_expression
string_literal
" "\""
string_fragment "Unknown key: "
" "\""
+ "+"
identifier "columnKey"
) ")"
; ";"
} "}"
local_variable_declaration
type_identifier "Iterator"
variable_declarator
identifier "iterator"
= "="
method_invocation
field_access
this "this"
. "."
identifier "rows"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
method_invocation
identifier "iterator"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "DefaultKeyedValues"
variable_declarator
identifier "rowData"
= "="
cast_expression
( "("
type_identifier "DefaultKeyedValues"
) ")"
method_invocation
identifier "iterator"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "index"
= "="
method_invocation
identifier "rowData"
. "."
identifier "getIndex"
argument_list
( "("
identifier "columnKey"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "index"
>= ">="
decimal_integer_literal "0"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "rowData"
. "."
identifier "removeValue"
argument_list
( "("
identifier "columnKey"
) ")"
; ";"
} "}"
} "}"
expression_statement
method_invocation
field_access
this "this"
. "."
identifier "columnKeys"
. "."
identifier "remove"
argument_list
( "("
identifier "columnKey"
) ")"
; ";"
} "}"
block_comment "/**\r\n * Clears all the data and associated keys.\r\n *"...
method_declaration (+47 nodes collapsed)
block_comment "/**\r\n * Tests if this object is equal to another.\r\n "...
method_declaration (+344 nodes collapsed)
block_comment "/**\r\n * Returns a hash code.\r\n * \r\n * @return A "...
method_declaration (+79 nodes collapsed)
block_comment "/**\r\n * Returns a clone.\r\n * \r\n * @return A clon"...
method_declaration (+109 nodes collapsed)
} "}"