1 package jalview.bin.argparser;
3 import jalview.bin.argparser.Arg.Opt;
4 import jalview.bin.argparser.Arg.Type;
7 * A helper class to keep an index of argument position with argument values
9 public class ArgValue implements Comparable<ArgValue>
18 * Type type is only really used by --help-type
20 private Type type = null;
23 * This id is set by a subVal id= to identify the product of this ArgValue
24 * later. Set but not currently used.
28 private SubVals subVals;
30 protected ArgValue(Arg a, SubVals sv, Type type, String content,
35 this.argIndex = argIndex;
36 this.subVals = sv == null ? new SubVals("") : sv;
40 protected ArgValue(Arg a, Type type, String value, int argIndex)
43 this.argIndex = argIndex;
44 this.subVals = new SubVals(value);
45 this.value = getSubVals().getContent();
49 protected void setType(Type t)
51 if (this.getArg().hasOption(Opt.HASTYPE))
65 public String getValue()
70 public int getArgIndex()
75 protected void setId(String i)
85 public SubVals getSubVals()
90 public String getSubVal(String key)
92 if (subVals == null || !subVals.has(key))
94 return subVals.get(key);
97 protected void putSubVal(String key, String val)
99 this.subVals.put(key, val);
103 public final int compareTo(ArgValue o)
105 return this.getArgIndex() - o.getArgIndex();