Top Description Inners Fields Constructors Methods
org.apache.tools.ant.types

public Class Quantifier

extends EnumeratedAttribute
Class Inheritance
Imports
java.util.Collection, .Collections, .LinkedHashSet, .Set, java.util.stream.Stream, org.apache.tools.ant.BuildException

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
public static final Quantifier
ALL

ALL instance

public static final Quantifier
ANY

ANY instance

public static final Quantifier
MAJORITY

MAJORITY instance

public static final Quantifier
NONE

NONE instance

public static final Quantifier
ONE

ONE instance

private static final String[]
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
value

Constructor Summary

AccessConstructor and Description
public
Quantifier()

Default constructor.

public
Quantifier(String
the EnumeratedAttribute value.
value
)

Construct a new Quantifier with the specified value.

private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the argument fell within the parameters of this Quantifier.
evaluate
(boolean[]
the boolean[] to evaluate.
b
)

Evaluate a boolean array.

public boolean

Returns:

true if the arguments fell within the parameters of this Quantifier.
evaluate
(int
the number of true values.
t
,
int
the number of false values.
f
)

Evaluate integer true vs. false counts.

public String[]

Returns:

String[] of EnumeratedAttribute values.
getValues
()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Return the possible values.
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
containsValuegetIndexgetInstancegetValueindexOfValuesetValuetoString

Field Detail

ALLback to summary
public static final Quantifier ALL

ALL instance

ANYback to summary
public static final Quantifier ANY

ANY instance

MAJORITYback to summary
public static final Quantifier MAJORITY

MAJORITY instance

NONEback to summary
public static final Quantifier NONE

NONE instance

ONEback to summary
public static final Quantifier ONE

ONE instance

VALUESback to summary
private static final String[] VALUES

Constructor Detail

Quantifierback to summary
public Quantifier()

Default constructor.

Quantifierback to summary
public Quantifier(String value)

Construct a new Quantifier with the specified value.

Parameters
value:String

the EnumeratedAttribute value.

Quantifierback to summary
private Quantifier(Quantifier.Predicate impl)

Method Detail

evaluateback to summary
public boolean evaluate(boolean[] b)

Evaluate a boolean array.

Parameters
b:boolean[]

the boolean[] to evaluate.

Returns:boolean

true if the argument fell within the parameters of this Quantifier.

evaluateback to summary
public boolean evaluate(int t, int f)

Evaluate integer true vs. false counts.

Parameters
t:int

the number of true values.

f:int

the number of false values.

Returns:boolean

true if the arguments fell within the parameters of this Quantifier.

getValuesback to summary
public String[] getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Return the possible values.

Returns:String[]

String[] of EnumeratedAttribute values.

Annotations
@Override
org.apache.tools.ant.types back to summary

private sealed Enum Quantifier.Predicate

extends Enum<Quantifier.Predicate>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Quantifier.Predicate
public static final Quantifier.Predicate
public static final Quantifier.Predicate
pack-priv final Set<String>
public static final Quantifier.Predicate
public static final Quantifier.Predicate

Constructor Summary

AccessConstructor and Description
private
Predicate(String primaryName, String... additionalNames)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract boolean
eval(int t, int f)

pack-priv static Quantifier.Predicate
get(String name)

pack-priv Set<String>
public static Quantifier.Predicate
public static Quantifier.Predicate[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final Quantifier.Predicate ALL
ANYback to summary
public static final Quantifier.Predicate ANY
MAJORITYback to summary
public static final Quantifier.Predicate MAJORITY
namesback to summary
pack-priv final Set<String> names
NONEback to summary
public static final Quantifier.Predicate NONE
ONEback to summary
public static final Quantifier.Predicate ONE

Constructor Detail

Predicateback to summary
private Predicate(String primaryName, String... additionalNames)

Method Detail

evalback to summary
pack-priv abstract boolean eval(int t, int f)
getback to summary
pack-priv static Quantifier.Predicate get(String name)
getNamesback to summary
pack-priv Set<String> getNames()
valueOfback to summary
public static Quantifier.Predicate valueOf(String name)
valuesback to summary
public static Quantifier.Predicate[] values()