All Implemented Interfaces:
Constraint

public class Size extends ConstraintAdapter
Checks the size of the generated elements of the wrapped constraint.
Author:
Ozgun Babur
  • Constructor Details

    • Size

      public Size(Constraint con, int size, Size.Type type)
      Constructor with parameters.
      Parameters:
      con - wrapped generative constraint
      size - size threshold
      type - type of (in)equality
  • Method Details

    • getVariableSize

      public int getVariableSize()
      Size is one less than the size of wrapped constraint.
      Specified by:
      getVariableSize in interface Constraint
      Overrides:
      getVariableSize in class ConstraintAdapter
      Returns:
      one less than the size of wrapped constraint
    • satisfies

      public boolean satisfies(Match match, int... ind)
      Checks if generated element size is in limits.
      Specified by:
      satisfies in interface Constraint
      Overrides:
      satisfies in class ConstraintAdapter
      Parameters:
      match - current pattern match
      ind - mapped indices
      Returns:
      true if generated element size is in limits