private void addValue(Option opt, Object value) { String lf = opt.longForm(); Vector v = (Vector)values.get(lf); if (v == null) { v = new Vector(); values.put(lf, v); } v.addElement(value); }
private void addValue(Option opt, Object value) { String lf = opt.longForm(); Vector v = (Vector)values.get(lf); if (v == null) { v = new Vector(); values.put(lf, v); } v.addElement(value); }
private void addValue(Option opt, Object value) { String lf = opt.longForm(); Vector v = (Vector)values.get(lf); if (v == null) { v = new Vector(); values.put(lf, v); } v.addElement(value); }
/** * @return the parsed value of the given Option, or null if the * option was not set */ public final Object getOptionValue( Option o, Object def ) { Vector v = (Vector)values.get(o.longForm()); if (v == null) { return def; } else if (v.isEmpty()) { return null; } else { Object result = v.elementAt(0); v.removeElementAt(0); return result; } }
/** * @return the parsed value of the given Option, or null if the * option was not set */ public final Object getOptionValue( Option o, Object def ) { Vector v = (Vector)values.get(o.longForm()); if (v == null) { return def; } else if (v.isEmpty()) { return null; } else { Object result = v.elementAt(0); v.removeElementAt(0); return result; } }
/** * Adds the value. * * @param opt * the opt * @param value * the value */ @SuppressWarnings("unchecked") private void addValue(Option opt, Object value) { String lf = opt.longForm(); List<Object> v = (ArrayList<Object>) values.get(lf); if (v == null) { v = new ArrayList<>(); values.put(lf, v); } v.add(value); }
/** * @return the parsed value of the given Option, or null if the * option was not set */ public final Object getOptionValue( Option o, Object def ) { Vector v = (Vector)values.get(o.longForm()); if (v == null) { return def; } else if (v.isEmpty()) { return null; } else { Object result = v.elementAt(0); v.removeElementAt(0); return result; } }
/** * @return the parsed value of the given Option, or the given default 'def' * if the option was not set */ public final Object getOptionValue( Option o, Object def ) { Vector v = (Vector)values.get(o.longForm()); if (v == null) { return def; } else if (v.isEmpty()) { return null; } else { Object result = v.elementAt(0); v.removeElementAt(0); return result; } }
/** * Instantiates a new illegal option value exception. * * @param opt * the opt * @param value * the value */ public IllegalOptionValueException(Option opt, String value) { super("Illegal value '" + value + "' for option " + (opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") + "--" + opt.longForm()); this.option = opt; this.value = value; }
/** * Add the specified Option to the list of accepted options. * * @param opt * the opt * @return the option */ public final Option addOption(Option opt) { if (opt.shortForm() != null) { this.options.put("-" + opt.shortForm(), opt); } this.options.put("--" + opt.longForm(), opt); return opt; }
private void addValue(Option opt, Object value) { String lf = opt.longForm(); Vector v = (Vector)values.get(lf); if (v == null) { v = new Vector(); values.put(lf, v); } v.addElement(value); }
public IllegalOptionValueException( Option opt, String value ) { super("Illegal value '" + value + "' for option " + (opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") + "--" + opt.longForm()); this.option = opt; this.value = value; }
/** * Add the specified Option to the list of accepted options */ public final Option addOption( Option opt ) { if ( opt.shortForm() != null ) this.options.put("-" + opt.shortForm(), opt); this.options.put("--" + opt.longForm(), opt); return opt; }
/** * Add the specified Option to the list of accepted options */ public final Option addOption( Option opt ) { if ( opt.shortForm() != null ) this.options.put("-" + opt.shortForm(), opt); this.options.put("--" + opt.longForm(), opt); return opt; }
/** * Add the specified Option to the list of accepted options */ public final Option addOption( Option opt ) { if ( opt.shortForm() != null ) this.options.put("-" + opt.shortForm(), opt); this.options.put("--" + opt.longForm(), opt); return opt; }
public IllegalOptionValueException( Option opt, String value ) { super("Illegal value '" + value + "' for option " + (opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") + "--" + opt.longForm()); this.option = opt; this.value = value; }
public IllegalOptionValueException( Option opt, String value ) { super("Illegal value '" + value + "' for option " + (opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") + "--" + opt.longForm()); this.option = opt; this.value = value; }
public Option addHelp(Option option, String helpString) { optionHelpStrings.add(" -" + option.shortForm() + "/--" + option.longForm() + ": " + helpString); return option; }
/** * Add the specified Option to the list of accepted options */ public final Option addOption( Option opt ) { if ( opt.shortForm() != null ) this.options.put("-" + opt.shortForm(), opt); this.options.put("--" + opt.longForm(), opt); return opt; }
public IllegalOptionValueException( Option opt, String value ) { super("Illegal value '" + value + "' for option " + (opt.shortForm() != null ? "-" + opt.shortForm() + "/" : "") + "--" + opt.longForm()); this.option = opt; this.value = value; }