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–281 unchanged (281 lines)
282 * <p>
283 * The map keys are column names. The map values are 0-based indices.
284 * </p>
285 * @return a copy of the header map that iterates in column order.
286 */
287 public Map<String, Integer> getHeaderMap() {
288 return new LinkedHashMap<String, Integer>(this.headerMap);
289 }
290
291 /**
292 * Returns the current record number in the input stream.
293 * <p/>
294 * ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the line number.
…lines 295–464 unchanged (170 lines)

After

…lines 1–281 unchanged (281 lines)
282 * <p>
283 * The map keys are column names. The map values are 0-based indices.
284 * </p>
285 * @return a copy of the header map that iterates in column order.
286 */
287 public Map<String, Integer> getHeaderMap() {
288 return this.headerMap == null ? null : new LinkedHashMap<String, Integer>(this.headerMap);
289 }
290
291 /**
292 * Returns the current record number in the input stream.
293 * <p/>
294 * ATTENTION: If your CSV input has multi-line values, the returned number does not correspond to the line number.
…lines 295–464 unchanged (170 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "csv"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Closeable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStreamReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Reader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "net"
. "."
identifier "URL"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
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 "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "NoSuchElementException"
; ";"
block_comment "/**\n * Parses CSV files according to the specified format.\n "...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "CSVParser"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "CSVRecord"
> ">"
, ","
type_identifier "Closeable"
class_body
{ "{"
block_comment "/**\n * Creates a parser for the given {@link File}.\n "...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * Creates a parser for the given {@link String}.\n "...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * Creates a parser for the given URL.\n *\n *"...
method_declaration (+117 nodes collapsed)
line_comment "// the following objects are shared to reduce garbage"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CSVFormat"
variable_declarator
identifier "format"
; ";"
block_comment "/** A mapping of column names to column indices */"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
variable_declarator
identifier "headerMap"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Lexer"
variable_declarator
identifier "lexer"
; ";"
block_comment "/** A record buffer for getRecord(). Grows as necessary and "...
field_declaration (+25 nodes collapsed)
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "recordNumber"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Token"
variable_declarator
identifier "reusableToken"
= "="
object_creation_expression
new "new"
type_identifier "Token"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Customized CSV parser using the given {@link CSVF"...
constructor_declaration (+110 nodes collapsed)
method_declaration (+104 nodes collapsed)
block_comment "/**\n * Closes resources.\n *\n * @throws IOExcepti"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Returns the current line number in the input stre"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns a copy of the header map that iterates in"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
identifier "getHeaderMap"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
object_creation_expression
new "new"
generic_type
type_identifier "LinkedHashMap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
argument_list
( "("
field_access
this "this"
. "."
identifier "headerMap"
) ")"
; ";"
} "}"
block_comment "/**\n * Returns the current record number in the input st"...
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getRecordNumber"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "recordNumber"
; ";"
} "}"
block_comment "/**\n * Parses the CSV input according to the given forma"...
method_declaration (+86 nodes collapsed)
block_comment "/**\n * Initializes the name to index mapping if the form"...
method_declaration (+256 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns an iterator on the records.\n *\n *"...
method_declaration (+301 nodes collapsed)
block_comment "/**\n * Parses the next record from the current point in "...
method_declaration (+383 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "csv"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Closeable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "File"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "FileReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStreamReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Reader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "net"
. "."
identifier "URL"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
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 "LinkedHashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "NoSuchElementException"
; ";"
block_comment "/**\n * Parses CSV files according to the specified format.\n "...
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "CSVParser"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "Iterable"
type_arguments
< "<"
type_identifier "CSVRecord"
> ">"
, ","
type_identifier "Closeable"
class_body
{ "{"
block_comment "/**\n * Creates a parser for the given {@link File}.\n "...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * Creates a parser for the given {@link String}.\n "...
method_declaration (+72 nodes collapsed)
block_comment "/**\n * Creates a parser for the given URL.\n *\n *"...
method_declaration (+117 nodes collapsed)
line_comment "// the following objects are shared to reduce garbage"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CSVFormat"
variable_declarator
identifier "format"
; ";"
block_comment "/** A mapping of column names to column indices */"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
variable_declarator
identifier "headerMap"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Lexer"
variable_declarator
identifier "lexer"
; ";"
block_comment "/** A record buffer for getRecord(). Grows as necessary and "...
field_declaration (+25 nodes collapsed)
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "recordNumber"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Token"
variable_declarator
identifier "reusableToken"
= "="
object_creation_expression
new "new"
type_identifier "Token"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Customized CSV parser using the given {@link CSVF"...
constructor_declaration (+110 nodes collapsed)
method_declaration (+104 nodes collapsed)
block_comment "/**\n * Closes resources.\n *\n * @throws IOExcepti"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Returns the current line number in the input stre"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Returns a copy of the header map that iterates in"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
identifier "getHeaderMap"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
ternary_expression
binary_expression
field_access
this "this"
. "."
identifier "headerMap"
== "=="
null_literal "null"
? "?"
null_literal "null"
: ":"
object_creation_expression
new "new"
generic_type
type_identifier "LinkedHashMap"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Integer"
> ">"
argument_list
( "("
field_access
this "this"
. "."
identifier "headerMap"
) ")"
; ";"
} "}"
block_comment "/**\n * Returns the current record number in the input st"...
method_declaration
modifiers
public "public"
integral_type
long "long"
identifier "getRecordNumber"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
this "this"
. "."
identifier "recordNumber"
; ";"
} "}"
block_comment "/**\n * Parses the CSV input according to the given forma"...
method_declaration (+86 nodes collapsed)
block_comment "/**\n * Initializes the name to index mapping if the form"...
method_declaration (+256 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns an iterator on the records.\n *\n *"...
method_declaration (+301 nodes collapsed)
block_comment "/**\n * Parses the next record from the current point in "...
method_declaration (+383 nodes collapsed)
} "}"