/**
* A helper class to keep an index of argument position with argument values
*/
-public class ArgValue
+public class ArgValue implements Comparable<ArgValue>
{
+ private Arg arg;
+
private int argIndex;
private String value;
private SubVals subVals;
- protected ArgValue(SubVals sv, String content, int argIndex)
+ protected ArgValue(Arg a, SubVals sv, String content, int argIndex)
{
+ this.arg = a;
this.value = content;
this.argIndex = argIndex;
this.subVals = sv == null ? new SubVals("") : sv;
}
- protected ArgValue(String value, int argIndex)
+ protected ArgValue(Arg a, String value, int argIndex)
{
+ this.arg = a;
this.argIndex = argIndex;
this.subVals = new SubVals(value);
this.value = getSubVals().getContent();
}
+ public Arg getArg()
+ {
+ return arg;
+ }
+
public String getValue()
{
return value;
{
this.subVals.put(key, val);
}
+
+ @Override
+ public int compareTo(ArgValue o)
+ {
+ return this.getArgIndex() - o.getArgIndex();
+ }
}
\ No newline at end of file