git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-629 Change --open to --append and --opennew to --open. Make --open(new) part...
[jalview.git]
/
src
/
jalview
/
bin
/
argparser
/
ArgValue.java
diff --git
a/src/jalview/bin/argparser/ArgValue.java
b/src/jalview/bin/argparser/ArgValue.java
index
28cead9
..
36901df
100644
(file)
--- a/
src/jalview/bin/argparser/ArgValue.java
+++ b/
src/jalview/bin/argparser/ArgValue.java
@@
-3,30
+3,39
@@
package jalview.bin.argparser;
/**
* A helper class to keep an index of argument position with argument values
*/
/**
* 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 String id;
private int argIndex;
private String value;
private String id;
- private SubVals subVals = null;
+ 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.value = content;
this.argIndex = argIndex;
- this.subVals = sv;
+ 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.argIndex = argIndex;
- this.subVals = ArgParser.getSubVals(value);
+ this.subVals = new SubVals(value);
this.value = getSubVals().getContent();
}
this.value = getSubVals().getContent();
}
+ public Arg getArg()
+ {
+ return arg;
+ }
+
public String getValue()
{
return value;
public String getValue()
{
return value;
@@
-63,4
+72,10
@@
public class ArgValue
{
this.subVals.put(key, val);
}
{
this.subVals.put(key, val);
}
+
+ @Override
+ public int compareTo(ArgValue o)
+ {
+ return this.getArgIndex() - o.getArgIndex();
+ }
}
\ No newline at end of file
}
\ No newline at end of file