// the first bag and a single value from the second bag, and if
// any evaluation is true return true, otherwise return false
result = new EvaluationResult(BooleanAttribute.getInstance(false));
Iterator<AttributeValue> it = ((BagAttribute) args[0]).iterator();
BagAttribute bag = (BagAttribute) (args[1]);
while (it.hasNext()) {
AttributeValue value = it.next();
result = any(value, bag, function, context, false);
if (result.indeterminate())
return result;
if (((BooleanAttribute) (result.getAttributeValue())).getValue())
break;
}
break;
}
case ID_ALL_OF_ANY: {
// param: boolean-function, bag, bag of same type
// return: boolean
// iterate through the first bag, and if for each of those values
// one of the values in the second bag matches then return true,
// otherwise return false
result = allOfAny((BagAttribute) (args[1]), (BagAttribute) (args[0]), function, context);
break;
}
case ID_ANY_OF_ALL: {
// param: boolean-function, bag, bag of same type
// return: boolean
// iterate through the second bag, and if for each of those values
// one of the values in the first bag matches then return true,
// otherwise return false
result = anyOfAll((BagAttribute) (args[0]), (BagAttribute) (args[1]), function, context);
break;
}
case ID_ALL_OF_ALL: {
// param: boolean-function, bag, bag of same type
// return: boolean
// iterate through the first bag, and for each of those values
// if every value in the second bag matches using the given
// function, then return true, otherwise return false
result = new EvaluationResult(BooleanAttribute.getInstance(true));
Iterator<AttributeValue> it = ((BagAttribute) args[0]).iterator();
BagAttribute bag = (BagAttribute) (args[1]);
while (it.hasNext()) {
AttributeValue value = it.next();
result = all(value, bag, function, context);