java.lang.Object
org.checkerframework.afu.annotator.specification.CriterionList

public class CriterionList extends Object
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 Details

    • CriterionList

      public CriterionList()
      Creates a new CriterionList with no criterion.
    • CriterionList

      public CriterionList(Criterion c)
      Creates a new CriterionList containing just the given Criterion.
      Parameters:
      c - the sole criterion the list contains at the moment
  • Method Details

    • add

      public CriterionList add(Criterion c)
      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

      public Criteria criteria()
      Creates a Criteria object representing all the criterion in this list.
      Returns:
      a Criteria that contains all the criterion in this list
    • toString

      public String toString()
      Overrides:
      toString in class Object