Package org.apache.tools.ant.types
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 aboolean[]
or rawtrue
andfalse
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
thanfalse
- "most"
- more
true
thanfalse
- "none"
- none
true
- Since:
- Ant 1.7
-
-
Field Summary
Fields Modifier and Type Field Description static Quantifier
ALL
ALL instancestatic Quantifier
ANY
ANY instancestatic Quantifier
MAJORITY
MAJORITY instancestatic Quantifier
NONE
NONE instancestatic Quantifier
ONE
ONE instance-
Fields inherited from class org.apache.tools.ant.types.EnumeratedAttribute
value
-
-
Constructor Summary
Constructors Constructor Description Quantifier()
Default constructor.Quantifier(java.lang.String value)
Construct a new Quantifier with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(boolean[] b)
Evaluate aboolean
array.boolean
evaluate(int t, int f)
Evaluate integertrue
vs.java.lang.String[]
getValues()
Return the possible values.-
Methods inherited from class org.apache.tools.ant.types.EnumeratedAttribute
containsValue, getIndex, getInstance, getValue, indexOfValue, setValue, toString
-
-
-
-
Field Detail
-
ALL
public static final Quantifier ALL
ALL instance
-
ANY
public static final Quantifier ANY
ANY instance
-
ONE
public static final Quantifier ONE
ONE instance
-
MAJORITY
public static final Quantifier MAJORITY
MAJORITY instance
-
NONE
public static final Quantifier NONE
NONE instance
-
-
Method Detail
-
getValues
public java.lang.String[] getValues()
Return the possible values.- Specified by:
getValues
in classEnumeratedAttribute
- Returns:
- String[] of EnumeratedAttribute values.
-
evaluate
public boolean evaluate(boolean[] b)
Evaluate aboolean
array.- Parameters:
b
- theboolean[]
to evaluate.- Returns:
- true if the argument fell within the parameters of this Quantifier.
-
evaluate
public boolean evaluate(int t, int f)
Evaluate integertrue
vs.false
counts.- Parameters:
t
- the number oftrue
values.f
- the number offalse
values.- Returns:
- true if the arguments fell within the parameters of this Quantifier.
-
-