Class CriterionList
java.lang.Object
org.checkerframework.afu.annotator.specification.CriterionList
A CriterionList is a singly-linked list of Criterion meant to be treated as a stack. It is useful
for creating base criteria and passing independent copies to different parts of a specification
that creates all the criterion. A CriterionList is immutable, and so copies created by the add()
function can safely be passed anywhere. It is supposed to be easier to manipulate than a
Criteria.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new CriterionList with no criterion.Creates a new CriterionList containing just the given Criterion. -
Method Summary
-
Constructor Details
-
CriterionList
public CriterionList()Creates a new CriterionList with no criterion. -
CriterionList
Creates a new CriterionList containing just the given Criterion.- Parameters:
c
- the sole criterion the list contains at the moment
-
-
Method Details
-
add
Adds the given criterion to the present list and returns a newly-allocated list containing the result. Does not modify its argument.- Parameters:
c
- the criterion to add- Returns:
- a new list containing the given criterion and the rest of the criterion already in this list
-
criteria
Creates a Criteria object representing all the criterion in this list.- Returns:
- a Criteria that contains all the criterion in this list
-
toString
-