| java.lang.Object org.apache.tools.ant.types.EnumeratedAttribute org.apache.tools.ant.types.TimeComparison
TimeComparison | public class TimeComparison extends EnumeratedAttribute (Code) | | EnumeratedAttribute for time comparisons. Accepts values
"before", "after", "equal".
since: Ant 1.7 |
Method Summary | |
public static int | compare(long t1, long t2) Compare two times.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. | public static int | compare(long t1, long t2, long g) Compare two times.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. Parameters: g - the timestamp granularity. | public boolean | evaluate(long t1, long t2) Evaluate two times against this TimeComparison.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. | public boolean | evaluate(long t1, long t2, long g) Evaluate two times against this TimeComparison.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. Parameters: g - the timestamp granularity. | public String[] | getValues() Return the possible values. |
TimeComparison | public TimeComparison()(Code) | | Default constructor.
|
TimeComparison | public TimeComparison(String value)(Code) | | Construct a new TimeComparison with the specified value.
Parameters: value - the EnumeratedAttribute value. |
compare | public static int compare(long t1, long t2)(Code) | | Compare two times.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. a negative integer, a positive integer, or zero as t1 isbefore, after, or equal to t2 accounting for the default granularity. |
compare | public static int compare(long t1, long t2, long g)(Code) | | Compare two times.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. Parameters: g - the timestamp granularity. a negative integer, a positive integer, or zero as t1 isbefore, after, or equal to t2 accounting for the specified granularity. |
evaluate | public boolean evaluate(long t1, long t2)(Code) | | Evaluate two times against this TimeComparison.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. true if the comparison result fell within the parameters of this TimeComparison. |
evaluate | public boolean evaluate(long t1, long t2, long g)(Code) | | Evaluate two times against this TimeComparison.
Parameters: t1 - the first time to compare. Parameters: t2 - the second time to compare. Parameters: g - the timestamp granularity. true if the comparison result fell within the parameters of this TimeComparison. |
getValues | public String[] getValues()(Code) | | Return the possible values.
String[] of EnumeratedAttribute values. |
|
|