* If @multi-check = true, return each CheckResultInstance
* If @multi-check = false, return this instance</li>
*/
// TODO: P5: figure out how to avoid using the adapters
public Collection<? extends CheckingUnitResult> evaluate(CheckResults checkResults) {
CheckResult checkResult = checkResults.getCheckResult(this);
Collection<? extends CheckingUnitResult> retval;
if (checkResult == null) {
// The check was not evaluated by the check interpreter
// TODO: P3: Should this be UNKNOWN? Perhaps the XCCDF spec is in error?
checkResult = new UncheckedCheckResult(this);
}
if (isMultiCheck()) {
retval = newCheckResultInstanceAdapterCollection(checkResult.getResultInstances());
} else {
retval = Collections.<CheckingUnitResult>singleton(new CheckResultAdapter(checkResult));
}
return retval;
}