public class PrologRuleEvaluator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PrologRuleEvaluator.Factory |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<SubmitRecord> |
evaluate()
Evaluate the submit rules.
|
SubmitTypeRecord |
getSubmitType()
Evaluate the submit type rules to get the submit type.
|
java.util.List<SubmitRecord> |
resultsToSubmitRecord(com.googlecode.prolog_cafe.lang.Term submitRule,
java.util.List<com.googlecode.prolog_cafe.lang.Term> results)
Convert the results from Prolog Cafe's format to Gerrit's common format.
|
public java.util.Collection<SubmitRecord> evaluate()
SubmitRecord
objects returned from the evaluated rules, including any
errors.public java.util.List<SubmitRecord> resultsToSubmitRecord(com.googlecode.prolog_cafe.lang.Term submitRule, java.util.List<com.googlecode.prolog_cafe.lang.Term> results)
can_submit/1 terminates when an ok(P) record is found. Therefore walk the results backwards, using only that ok(P) record if it exists. This skips partial results that occur early in the output. Later after the loop the out collection is reversed to restore it to the original ordering.
public SubmitTypeRecord getSubmitType()