Package org.apache.tools.ant.types
Class Comparison
java.lang.Object
org.apache.tools.ant.types.EnumeratedAttribute
org.apache.tools.ant.types.Comparison
- Direct Known Subclasses:
Length.When
,SizeSelector.SizeComparisons
EnumeratedAttribute for generic comparisons. Accepts values
"equal", "greater", "more", "less", "ne" (not equal),
"ge" (greater or equal), "le" (less or equal), "eq" (equal),
"gt" (greater), "lt" (less).
- Since:
- Ant 1.7
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparison
Equal Comparison.static final Comparison
Greater Comparison.static final Comparison
Greater-or-Equal Comparison.static final Comparison
Less Comparison.static final Comparison
Less-or-Equal Comparison.static final Comparison
Not-Equal Comparison.Fields inherited from class org.apache.tools.ant.types.EnumeratedAttribute
value
-
Constructor Summary
ConstructorDescriptionDefault constructor.Comparison
(String value) Construct a new Comparison with the specified value. -
Method Summary
Methods inherited from class org.apache.tools.ant.types.EnumeratedAttribute
containsValue, getIndex, getInstance, getValue, indexOfValue, setValue, toString
-
Field Details
-
EQUAL
Equal Comparison. -
NOT_EQUAL
Not-Equal Comparison. -
GREATER
Greater Comparison. -
LESS
Less Comparison. -
GREATER_EQUAL
Greater-or-Equal Comparison. -
LESS_EQUAL
Less-or-Equal Comparison.
-
-
Constructor Details
-
Comparison
public Comparison()Default constructor. -
Comparison
Construct a new Comparison with the specified value.- Parameters:
value
- the EnumeratedAttribute value.
-
-
Method Details
-
getValues
Return the possible values.- Specified by:
getValues
in classEnumeratedAttribute
- Returns:
- String[] of EnumeratedAttribute values.
-
evaluate
public boolean evaluate(int comparisonResult) Evaluate a comparison result as from Comparator.compare() or Comparable.compareTo().- Parameters:
comparisonResult
- the result to evaluate.- Returns:
- true if the comparison result fell within the parameters of this Comparison.
-