}
else if (a.hasOption(Opt.BOOLEAN))
{
- setBoolean(linkedId, type, avs, !negated, argIndex);
+ setBoolean(linkedId, givenLinkedId, type, avs, !negated,
+ argIndex);
- setNegated(linkedId, avs, negated);
}
else if (a.hasOption(Opt.UNARY))
{
/**
* This version inserts the subvals sv into all created values
*/
- private void addValue(String linkedId, Type type, ArgValues avs,
- SubVals sv, String v, int argIndex, boolean doSubs)
+ private void addValue(String linkedId, String givenLinkedId, Type type,
+ ArgValues avs, SubVals sv, String v, int argIndex, boolean doSubs)
{
- this.argValueOperation(Op.ADDVALUE, linkedId, type, avs, sv, v, false,
- argIndex, doSubs);
+ this.argValueOperation(Op.ADDVALUE, linkedId, givenLinkedId, type, avs,
+ sv, v, false, argIndex, doSubs);
}
- private void setBoolean(String linkedId, Type type, ArgValues avs,
- boolean b, int argIndex)
+ private void setBoolean(String linkedId, String givenLinkedId, Type type,
+ ArgValues avs, boolean b, int argIndex)
{
- this.argValueOperation(Op.SETBOOLEAN, linkedId, type, avs, null, null,
- b, argIndex, false);
+ this.argValueOperation(Op.SETBOOLEAN, linkedId, givenLinkedId, type,
+ avs, null, null, b, argIndex, false);
}
- private void setNegated(String linkedId, ArgValues avs, boolean b)
- {
- this.argValueOperation(Op.SETNEGATED, linkedId, null, null, avs, null,
- null, b, 0, false);
- }
-
private void incrementCount(String linkedId, ArgValues avs)
{
- this.argValueOperation(Op.INCREMENTCOUNT, linkedId, null, avs, null,
- null, false, 0, false);
+ this.argValueOperation(Op.INCREMENTCOUNT, linkedId, null, null, avs,
+ null, null, false, 0, false);
}
private enum Op
{
- ADDVALUE, SETBOOLEAN, SETNEGATED, INCREMENTCOUNT
+ ADDVALUE, SETBOOLEAN, INCREMENTCOUNT
}
- private void argValueOperation(Op op, String linkedId, Type type,
- ArgValues avs, SubVals sv, String v, boolean b, int argIndex,
- boolean doSubs)
+ private void argValueOperation(Op op, String linkedId,
+ String givenLinkedId, Type type, ArgValues avs, SubVals sv,
+ String v, boolean b, int argIndex, boolean doSubs)
{
// default to merge subvals if subvals are provided
- argValueOperation(op, linkedId, type, avs, sv, true, v, b, argIndex,
- doSubs);
+ argValueOperation(op, linkedId, givenLinkedId, type, avs, sv, true, v,
+ b, argIndex, doSubs);
}
/**
break;
case SETBOOLEAN:
- tavs.setBoolean(type, b, argIndex, true, givenLinkedId);
- finaliseStoringArgValue(matchedLinkedId, tavs);
- break;
-
- case SETNEGATED:
- tavs.setNegated(b, true);
- break;
-
- case INCREMENTCOUNT:
- tavs.incrementCount();
- break;
-
- default:
+ if (getPrioritisePositiveBooleanValue() && tavs.getCount() > 0
+ && tavs.getBoolean())
+ {
+ Console.debug("Not setting due to prioritisePositiveValue and '"
+ + a.argString() + "' has already been set to true");
+ }
+ else
+ {
- tavs.setBoolean(type, b, argIndex, true);
++ tavs.setBoolean(type, b, argIndex, true, givenLinkedId);
+ if (a.hasOption(Opt.BOOLEAN))
+ {
+ tavs.setNegated(!b, true);
+ }
- finaliseStoringArgValue(id, tavs);
++ finaliseStoringArgValue(matchedLinkedId, tavs);
+ }
break;
-
}
}
break;
case SETBOOLEAN:
- avs.setBoolean(type, b, argIndex, false, givenLinkedId);
- finaliseStoringArgValue(linkedId, avs);
- break;
-
- case SETNEGATED:
- avs.setNegated(b, false);
+ if (getPrioritisePositiveBooleanValue() && avs.getCount() > 0
+ && avs.getBoolean())
+ {
+ Console.debug("Not setting due to prioritisePositiveValue and '"
+ + a.argString() + "' has already been set to true");
+ }
+ else
+ {
- avs.setBoolean(type, b, argIndex, false);
++ avs.setBoolean(type, b, argIndex, false, givenLinkedId);
+ if (a.hasOption(Opt.BOOLEAN))
+ {
+ avs.setNegated(!b, true);
+ }
+ finaliseStoringArgValue(linkedId, avs);
+ }
break;
case INCREMENTCOUNT: