org.apache.tools.ant.types

Class Quantifier


public class Quantifier
extends EnumeratedAttribute

EnumeratedAttribute for quantifier comparisons. Evaluates a boolean[] or raw true and false counts. Accepts the following values:
Since:
Ant 1.7

Field Summary

static Quantifier
ALL
ALL instance
static Quantifier
ANY
ANY instance
static Quantifier
MAJORITY
MAJORITY instance
static Quantifier
NONE
NONE instance
static Quantifier
ONE
ONE instance

Fields inherited from class org.apache.tools.ant.types.EnumeratedAttribute

value

Constructor Summary

Quantifier()
Default constructor.
Quantifier(String value)
Construct a new Quantifier with the specified value.

Method Summary

boolean
evaluate(boolean[] b)
Evaluate a boolean array.
boolean
evaluate(int t, int f)
Evaluate integer true vs.
String[]
getValues()
Return the possible values.

Methods inherited from class org.apache.tools.ant.types.EnumeratedAttribute

containsValue, getIndex, getInstance, getValue, getValues, indexOfValue, setValue, toString

Field Details

ALL

public static final Quantifier ALL
ALL instance

ANY

public static final Quantifier ANY
ANY instance

MAJORITY

public static final Quantifier MAJORITY
MAJORITY instance

NONE

public static final Quantifier NONE
NONE instance

ONE

public static final Quantifier ONE
ONE instance

Constructor Details

Quantifier

public Quantifier()
Default constructor.

Quantifier

public Quantifier(String value)
Construct a new Quantifier with the specified value.
Parameters:
value - the EnumeratedAttribute value.

Method Details

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.

getValues

public String[] getValues()
Return the possible values.
Overrides:
getValues in interface EnumeratedAttribute
Returns:
String[] of EnumeratedAttribute values.