Class Quantifier

java.lang.Object
org.apache.tools.ant.types.EnumeratedAttribute
org.apache.tools.ant.types.Quantifier

public class Quantifier
extends EnumeratedAttribute
EnumeratedAttribute for quantifier comparisons. Evaluates a boolean[] or raw true and false counts. Accepts the following values:
"all"
none false
"each"
none false
"every"
none false
"any"
at least one true
"some"
at least one true
"one"
exactly one true
"majority"
more true than false
"most"
more true than false
"none"
none true
Since:
Ant 1.7
  • Field Details

  • Constructor Details

    • Quantifier

      public Quantifier()
      Default constructor.
    • Quantifier

      public Quantifier​(java.lang.String value)
      Construct a new Quantifier with the specified value.
      Parameters:
      value - the EnumeratedAttribute value.
  • Method Details

    • getValues

      public java.lang.String[] getValues()
      Return the possible values.
      Specified by:
      getValues in class EnumeratedAttribute
      Returns:
      String[] of EnumeratedAttribute values.
    • evaluate

      public boolean evaluate​(boolean[] b)
      Evaluate a boolean array.
      Parameters:
      b - the boolean[] to evaluate.
      Returns:
      true if the argument fell within the parameters of this Quantifier.
    • evaluate

      public boolean evaluate​(int t, int f)
      Evaluate integer true vs. false counts.
      Parameters:
      t - the number of true values.
      f - the number of false values.
      Returns:
      true if the arguments fell within the parameters of this Quantifier.