private boolean defaultBoolValue = false;
- private int argIndex = -1;
-
public String toLongString()
{
StringBuilder sb = new StringBuilder();
{
return defaultBoolValue;
}
-
- private void setArgIndex(int i)
- {
- this.argIndex = i;
- }
-
- protected int getArgIndex()
- {
- return this.argIndex;
- }
}
public static class ArgValues
ArgValues av = getArgValues(a);
return av == null ? false : av.getBoolean();
}
+
+ protected ArgValue getClosestPreviousArgValueOfArg(ArgValue thisAv,
+ Arg a)
+ {
+ ArgValue closestAv = null;
+ int thisArgIndex = thisAv.getArgIndex();
+ ArgValues compareAvs = this.getArgValues(a);
+ int closestPreviousIndex = -1;
+ for (ArgValue av : compareAvs.getArgValueList())
+ {
+ int argIndex = av.getArgIndex();
+ if (argIndex < thisArgIndex && argIndex > closestPreviousIndex)
+ {
+ closestPreviousIndex = argIndex;
+ closestAv = av;
+ }
+ }
+ return closestAv;
+ }
}
- private static final Collection<String> bootstrapArgs = new ArrayList(
- Arrays.asList("props", "debug"));
+ private static final Collection<Arg> bootstrapArgs = new ArrayList(
+ Arrays.asList(Arg.PROPS, Arg.DEBUG));
- public static Map<String, String> bootstrapArgs(String[] args)
+ public static Map<Arg, String> bootstrapArgs(String[] args)
{
- Map<String, String> argMap = new HashMap<>();
+ Map<Arg, String> bootstrapArgMap = new HashMap<>();
if (args == null)
- return argMap;
+ return bootstrapArgMap;
Enumeration<String> argE = Collections.enumeration(Arrays.asList(args));
while (argE.hasMoreElements())
{
{
argName = arg.substring(2);
}
- if (bootstrapArgs.contains(argName))
- argMap.put(argName, val);
+ Arg a = argMap.get(argName);
+ if (a != null && bootstrapArgs.contains(a))
+ bootstrapArgMap.put(a, val);
}
}
- return argMap;
+ return bootstrapArgMap;
}
}
\ No newline at end of file