This mapping has 3 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

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–12 unchanged (12 lines)
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.apache.commons.cli;
17
18import java.util.Collection;
19import java.util.HashMap;
20import java.util.Iterator;
21import java.util.LinkedList;
22import java.util.List;
23import java.util.Map;
24
25/**
26 * <p>Represents list of arguments parsed against
27 * a {@link Options} descriptor.<p>
28 *
29 * <p>It allows querying of a boolean {@link #hasOption(String opt)},
…lines 30–39 unchanged (10 lines)
40public class CommandLine {
41
42 /** the unrecognised options/arguments */
43 private List args = new LinkedList();
44
45 /** the processed options */
46 private Map options = new HashMap();
47 private Map names = new HashMap();
48
49 /** Map of unique options for ease to get complete list of options */
50// private Set allOptions = new HashSet();
51 private Map hashcodeMap = new HashMap();
52
53 /**
54 * Creates a command line.
55 */
56 CommandLine()
57 {
…lines 58–62 unchanged (5 lines)
63 *
64 * @param opt Short name of the option
65 * @return true if set, false if not
66 */
67 public boolean hasOption(String opt)
68 {
69 return options.containsKey(opt);
70 }
71
72 /**
73 * Query to see if an option has been set.
74 *
75 * @param opt character name of the option
…lines 76–85 unchanged (10 lines)
86 * @param opt the name of the option
87 * @return the type of this <code>Option</code>
88 */
89 public Object getOptionObject(String opt)
90 {
91 String res = getOptionValue(opt);
92
93 if (!options.containsKey(opt))
94 {
95 return null;
96 }
97
98 Object type = ((Option) options.get(opt)).getType();
99
100 return (res == null) ? null : TypeHandler.createValue(res, type);
101 }
102
103 /**
104 * Return the <code>Object</code> type of this <code>Option</code>.
…lines 105–142 unchanged (38 lines)
143 * @param opt string name of the option
144 * @return Values of the argument if option is set, and has an argument,
145 * otherwise null.
146 */
147 public String[] getOptionValues(String opt)
148 {
149 opt = Util.stripLeadingHyphens(opt);
150
151 String key = opt;
152 if (names.containsKey(opt))
153
154 {
155 key = (String) names.get(opt);
156 }
157
158 if (options.containsKey(key))
159 {
160 return ((Option) options.get(key)).getValues();
161 }
162 return null;
163 }
164
165 /**
166 * <p>Retrieves the option object given the long or short option as a String</p>
167 * @param opt short or long name of the option
168 * @return Canonicalized option
169 */
170
171
172 /**
173 * Retrieves the array of values, if any, of an option.
174 *
175 * @param opt character name of the option
176 * @return Values of the argument if option is set, and has an argument,
…lines 177–271 unchanged (95 lines)
272 * the option are stored.
273 *
274 * @param opt the processed option
275 */
276 void addOption(Option opt)
277 {
278 hashcodeMap.put(new Integer(opt.hashCode()), opt);
279 String key = opt.getKey();
280 if (key == null)
281 {
282 key = opt.getLongOpt();
283 }
284 else
285 {
286 names.put(opt.getLongOpt(), key);
287 }
288 options.put(key, opt);
289 }
290
291 /**
292 * Returns an iterator over the Option members of CommandLine.
293 *
294 * @return an <code>Iterator</code> over the processed {@link Option}
295 * members of this {@link CommandLine}
296 */
297 public Iterator iterator()
298 {
299 return hashcodeMap.values().iterator();
300 }
301
302 /**
303 * Returns an array of the processed {@link Option}s.
304 *
305 * @return an array of the processed {@link Option}s.
306 */
307 public Option[] getOptions()
308 {
309 Collection processed = options.values();
310
311 // reinitialise array
312 Option[] optionsArray = new Option[processed.size()];
313
314 // return the array
315 return (Option[]) processed.toArray(optionsArray);
316 }
317}
318

After

…lines 1–12 unchanged (12 lines)
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.apache.commons.cli;
17
18import java.util.Collection;
19import java.util.Iterator;
20import java.util.LinkedList;
21import java.util.List;
22import java.util.Set;
23import java.util.HashSet;
24
25/**
26 * <p>Represents list of arguments parsed against
27 * a {@link Options} descriptor.<p>
28 *
29 * <p>It allows querying of a boolean {@link #hasOption(String opt)},
…lines 30–39 unchanged (10 lines)
40public class CommandLine {
41
42 /** the unrecognised options/arguments */
43 private List args = new LinkedList();
44
45 /** the processed options */
46 private Set options = new HashSet();
47
48 /** Map of unique options for ease to get complete list of options */
49// private Set allOptions = new HashSet();
50
51 /**
52 * Creates a command line.
53 */
54 CommandLine()
55 {
56 // nothing to do
…lines 57–60 unchanged (4 lines)
61 *
62 * @param opt Short name of the option
63 * @return true if set, false if not
64 */
65 public boolean hasOption(String opt)
66 {
67 return options.contains( resolveOption(opt));
68 }
69
70 /**
71 * Query to see if an option has been set.
72 *
73 * @param opt character name of the option
…lines 74–84 unchanged (11 lines)
85 * @return the type of this <code>Option</code>
86 */
87 public Object getOptionObject(String opt)
88 {
89 String res = getOptionValue(opt);
90
91 Option option = resolveOption(opt);
92 if (option == null)
93 {
94 return null;
95 }
96
97 Object type = option.getType();
98
99 return (res == null) ? null : TypeHandler.createValue(res, type);
100 }
101
102 /**
103 * Return the <code>Object</code> type of this <code>Option</code>.
…lines 104–141 unchanged (38 lines)
142 * @param opt string name of the option
143 * @return Values of the argument if option is set, and has an argument,
144 * otherwise null.
145 */
146 public String[] getOptionValues(String opt)
147 {
148 Option key = resolveOption( opt );
149
150 if (options.contains(key))
151 {
152 return key.getValues();
153 }
154
155 return null;
156 }
157
158 /**
159 * <p>Retrieves the option object given the long or short option as a String</p>
160 * @param opt short or long name of the option
161 * @return Canonicalized option
162 */
163 private Option resolveOption( String opt )
164 {
165 opt = Util.stripLeadingHyphens(opt);
166 for ( Iterator it = options.iterator(); it.hasNext(); )
167 {
168 Option option = (Option) it.next();
169 if (opt.equals(option.getOpt()))
170 {
171 return option;
172 }
173 if (opt.equals( option.getLongOpt()))
174 {
175 return option;
176 }
177
178 }
179 return null;
180 }
181
182 /**
183 * Retrieves the array of values, if any, of an option.
184 *
185 * @param opt character name of the option
186 * @return Values of the argument if option is set, and has an argument,
…lines 187–281 unchanged (95 lines)
282 * the option are stored.
283 *
284 * @param opt the processed option
285 */
286 void addOption(Option opt)
287 {
288 options.add(opt);
289 }
290
291 /**
292 * Returns an iterator over the Option members of CommandLine.
293 *
294 * @return an <code>Iterator</code> over the processed {@link Option}
295 * members of this {@link CommandLine}
296 */
297 public Iterator iterator()
298 {
299 return options.iterator();
300 }
301
302 /**
303 * Returns an array of the processed {@link Option}s.
304 *
305 * @return an array of the processed {@link Option}s.
306 */
307 public Option[] getOptions()
308 {
309 Collection processed = options;
310
311 // reinitialise array
312 Option[] optionsArray = new Option[processed.size()];
313
314 // return the array
315 return (Option[]) processed.toArray(optionsArray);
316 }
317}

Before

program
block_comment "/**\n * Copyright 1999-2001,2004 The Apache Software Foundati"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
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 "LinkedList"
; ";"
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"
; ";"
block_comment "/** \n * <p>Represents list of arguments parsed against\n * a "...
class_declaration
modifiers
public "public"
class "class"
identifier "CommandLine"
class_body
{ "{"
block_comment "/** the unrecognised options/arguments */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "args"
= "="
object_creation_expression
new "new"
type_identifier "LinkedList"
argument_list
( "("
) ")"
; ";"
block_comment "/** the processed options */"
field_declaration
modifiers
private "private"
type_identifier "Map"
variable_declarator
identifier "options"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Map"
variable_declarator
identifier "names"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
block_comment "/** Map of unique options for ease to get complete list of o"...
line_comment "// private Set allOptions = new HashSet();"
field_declaration
modifiers
private "private"
type_identifier "Map"
variable_declarator
identifier "hashcodeMap"
= "="
object_creation_expression
new "new"
type_identifier "HashMap"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Creates a command line.\n */"
constructor_declaration
identifier "CommandLine"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
line_comment "// nothing to do"
} "}"
block_comment "/** \n * Query to see if an option has been set.\n *\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "hasOption"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "options"
. "."
identifier "containsKey"
argument_list any 1:2
( "(" any 1:2
identifier "opt"
) ")" any 1:2
; ";"
} "}"
block_comment "/** \n * Query to see if an option has been set.\n *\n "...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Return the <code>Object</code> type of this <code"...
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "getOptionObject"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "res"
= "="
method_invocation
identifier "getOptionValue"
argument_list
( "("
identifier "opt"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
identifier "options"
. "."
identifier "containsKey"
argument_list
( "("
identifier "opt"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "type"
= "="
method_invocation
parenthesized_expression
( "("
cast_expression
( "("
type_identifier "Option"
) ")"
method_invocation
identifier "options"
. "."
identifier "get"
argument_list
( "("
identifier "opt"
) ")"
) ")"
. "."
identifier "getType"
argument_list
( "("
) ")"
; ";"
return_statement (+24 nodes collapsed)
} "}"
block_comment "/**\n * Return the <code>Object</code> type of this <code"...
method_declaration (+31 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of this option.\n "...
method_declaration (+49 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of this option.\n "...
method_declaration (+31 nodes collapsed)
block_comment "/** \n * Retrieves the array of values, if any, of an opt"...
method_declaration
modifiers
public "public"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "getOptionValues"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "opt"
) ")"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "key"
= "="
identifier "opt"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "names"
. "."
identifier "containsKey"
argument_list
( "("
identifier "opt"
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "key"
= "="
cast_expression
( "("
type_identifier "String"
) ")"
method_invocation
identifier "names"
. "."
identifier "get"
argument_list
( "("
identifier "opt"
) ")"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "containsKey"
argument_list
( "("
identifier "key"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
parenthesized_expression
( "("
cast_expression
( "("
type_identifier "Option"
) ")"
method_invocation
identifier "options"
. "."
identifier "get"
argument_list
( "("
identifier "key"
) ")"
) ")"
. "."
identifier "getValues"
argument_list
( "("
) ")"
; ";"
} "}"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * <p>Retrieves the option object given the long or "...
block_comment "/** \n * Retrieves the array of values, if any, of an opt"...
method_declaration (+35 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of an option.\n "...
method_declaration (+45 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of an option.\n "...
method_declaration (+37 nodes collapsed)
block_comment "/** \n * Retrieve any left-over non-recognized options an"...
method_declaration (+52 nodes collapsed)
block_comment "/** \n * Retrieve any left-over non-recognized options an"...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getArgList"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "args"
; ";"
} "}"
block_comment "/** \n * jkeyes\n * - commented out until it is implem"...
block_comment "/*\n public String toString() {\n StringBuffer buf ="...
block_comment "/**\n * Add left-over unrecognized option/argument.\n "...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Add an option to the command line. The values of"...
method_declaration
void_type "void"
identifier "addOption"
formal_parameters
( "("
formal_parameter
type_identifier "Option"
identifier "opt"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "hashcodeMap"
. "."
identifier "put"
argument_list
( "("
object_creation_expression
new "new"
type_identifier "Integer"
argument_list
( "("
method_invocation
identifier "opt"
. "."
identifier "hashCode"
argument_list
( "("
) ")"
) ")"
, ","
identifier "opt"
) ")"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "key"
= "="
method_invocation
identifier "opt"
. "."
identifier "getKey"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "key"
== "=="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "key"
= "="
method_invocation
identifier "opt"
. "."
identifier "getLongOpt"
argument_list
( "("
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
method_invocation
identifier "names"
. "."
identifier "put"
argument_list
( "("
method_invocation
identifier "opt"
. "."
identifier "getLongOpt"
argument_list
( "("
) ")"
, ","
identifier "key"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "options"
. "."
identifier "put"
argument_list
( "("
identifier "key"
, ","
identifier "opt"
) ")"
; ";"
} "}"
block_comment "/**\n * Returns an iterator over the Option members of Co"...
method_declaration
modifiers
public "public"
type_identifier "Iterator"
identifier "iterator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
method_invocation
identifier "hashcodeMap"
. "."
identifier "values"
argument_list
( "("
) ")"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Returns an array of the processed {@link Option}s"...
method_declaration
modifiers
public "public"
array_type
type_identifier "Option"
dimensions
[ "["
] "]"
identifier "getOptions"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Collection"
variable_declarator
identifier "processed"
= "="
method_invocation
identifier "options"
. "."
identifier "values"
argument_list
( "("
) ")"
; ";"
line_comment "// reinitialise array"
local_variable_declaration (+23 nodes collapsed)
line_comment "// return the array"
return_statement
return "return"
cast_expression
( "("
array_type
type_identifier "Option"
dimensions
[ "["
] "]"
) ")"
method_invocation
identifier "processed"
. "."
identifier "toArray"
argument_list
( "("
identifier "optionsArray"
) ")"
; ";"
} "}"
} "}"

After

program
block_comment "/**\n * Copyright 1999-2001,2004 The Apache Software Foundati"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
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 "LinkedList"
; ";"
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 "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
block_comment "/** \n * <p>Represents list of arguments parsed against\n * a "...
class_declaration
modifiers
public "public"
class "class"
identifier "CommandLine"
class_body
{ "{"
block_comment "/** the unrecognised options/arguments */"
field_declaration
modifiers
private "private"
type_identifier "List"
variable_declarator
identifier "args"
= "="
object_creation_expression
new "new"
type_identifier "LinkedList"
argument_list
( "("
) ")"
; ";"
block_comment "/** the processed options */"
field_declaration
modifiers
private "private"
type_identifier "Set"
variable_declarator
identifier "options"
= "="
object_creation_expression
new "new"
type_identifier "HashSet"
argument_list
( "("
) ")"
; ";"
block_comment "/** Map of unique options for ease to get complete list of o"...
line_comment "// private Set allOptions = new HashSet();"
block_comment "/**\n * Creates a command line.\n */"
constructor_declaration
identifier "CommandLine"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
line_comment "// nothing to do"
} "}"
block_comment "/** \n * Query to see if an option has been set.\n *\n "...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "hasOption"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "options"
. "."
identifier "contains"
argument_list any 1:2
( "(" any 1:2
method_invocation
identifier "resolveOption"
argument_list any 1:2
( "(" any 1:2
identifier "opt"
) ")" any 1:2
) ")" any 1:2
; ";"
} "}"
block_comment "/** \n * Query to see if an option has been set.\n *\n "...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Return the <code>Object</code> type of this <code"...
method_declaration
modifiers
public "public"
type_identifier "Object"
identifier "getOptionObject"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "res"
= "="
method_invocation
identifier "getOptionValue"
argument_list
( "("
identifier "opt"
) ")"
; ";"
local_variable_declaration
type_identifier "Option"
variable_declarator
identifier "option"
= "="
method_invocation
identifier "resolveOption"
argument_list
( "("
identifier "opt"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "option"
== "=="
null_literal "null"
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
local_variable_declaration
type_identifier "Object"
variable_declarator
identifier "type"
= "="
method_invocation
identifier "option"
. "."
identifier "getType"
argument_list
( "("
) ")"
; ";"
return_statement (+24 nodes collapsed)
} "}"
block_comment "/**\n * Return the <code>Object</code> type of this <code"...
method_declaration (+31 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of this option.\n "...
method_declaration (+49 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of this option.\n "...
method_declaration (+31 nodes collapsed)
block_comment "/** \n * Retrieves the array of values, if any, of an opt"...
method_declaration
modifiers
public "public"
array_type
type_identifier "String"
dimensions
[ "["
] "]"
identifier "getOptionValues"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Option"
variable_declarator
identifier "key"
= "="
method_invocation
identifier "resolveOption"
argument_list
( "("
identifier "opt"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "options"
. "."
identifier "contains"
argument_list
( "("
identifier "key"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "key"
. "."
identifier "getValues"
argument_list
( "("
) ")"
; ";"
} "}"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * <p>Retrieves the option object given the long or "...
method_declaration
modifiers
private "private"
type_identifier "Option"
identifier "resolveOption"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "opt"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "opt"
= "="
method_invocation
identifier "Util"
. "."
identifier "stripLeadingHyphens"
argument_list
( "("
identifier "opt"
) ")"
; ";"
for_statement
for "for"
( "("
local_variable_declaration
type_identifier "Iterator"
variable_declarator
identifier "it"
= "="
method_invocation
identifier "options"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
method_invocation
identifier "it"
. "."
identifier "hasNext"
argument_list
( "("
) ")"
; ";"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Option"
variable_declarator
identifier "option"
= "="
cast_expression
( "("
type_identifier "Option"
) ")"
method_invocation
identifier "it"
. "."
identifier "next"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "opt"
. "."
identifier "equals"
argument_list
( "("
method_invocation
identifier "option"
. "."
identifier "getOpt"
argument_list
( "("
) ")"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
identifier "option"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "opt"
. "."
identifier "equals"
argument_list
( "("
method_invocation
identifier "option"
. "."
identifier "getLongOpt"
argument_list
( "("
) ")"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
identifier "option"
; ";"
} "}"
} "}"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/** \n * Retrieves the array of values, if any, of an opt"...
method_declaration (+35 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of an option.\n "...
method_declaration (+45 nodes collapsed)
block_comment "/** \n * Retrieve the argument, if any, of an option.\n "...
method_declaration (+37 nodes collapsed)
block_comment "/** \n * Retrieve any left-over non-recognized options an"...
method_declaration (+52 nodes collapsed)
block_comment "/** \n * Retrieve any left-over non-recognized options an"...
method_declaration
modifiers
public "public"
type_identifier "List"
identifier "getArgList"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "args"
; ";"
} "}"
block_comment "/** \n * jkeyes\n * - commented out until it is implem"...
block_comment "/*\n public String toString() {\n StringBuffer buf ="...
block_comment "/**\n * Add left-over unrecognized option/argument.\n "...
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Add an option to the command line. The values of"...
method_declaration
void_type "void"
identifier "addOption"
formal_parameters
( "("
formal_parameter
type_identifier "Option"
identifier "opt"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "options"
. "."
identifier "add"
argument_list
( "("
identifier "opt"
) ")"
; ";"
} "}"
block_comment "/**\n * Returns an iterator over the Option members of Co"...
method_declaration
modifiers
public "public"
type_identifier "Iterator"
identifier "iterator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "options"
. "."
identifier "iterator"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Returns an array of the processed {@link Option}s"...
method_declaration
modifiers
public "public"
array_type
type_identifier "Option"
dimensions
[ "["
] "]"
identifier "getOptions"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Collection"
variable_declarator
identifier "processed"
= "="
identifier "options"
; ";"
line_comment "// reinitialise array"
local_variable_declaration (+23 nodes collapsed)
line_comment "// return the array"
return_statement
return "return"
cast_expression
( "("
array_type
type_identifier "Option"
dimensions
[ "["
] "]"
) ")"
method_invocation
identifier "processed"
. "."
identifier "toArray"
argument_list
( "("
identifier "optionsArray"
) ")"
; ";"
} "}"
} "}"