org.apache.tools.ant.types
Class TimeComparison
public class TimeComparison
EnumeratedAttribute for time comparisons. Accepts values
"before", "after", "equal".
static int | compare(long t1, long t2) - Compare two times.
|
static int | compare(long t1, long t2, long g) - Compare two times.
|
boolean | evaluate(long t1, long t2) - Evaluate two times against this TimeComparison.
|
boolean | evaluate(long t1, long t2, long g) - Evaluate two times against this TimeComparison.
|
String[] | getValues() - Return the possible values.
|
TimeComparison
public TimeComparison()
Default constructor.
TimeComparison
public TimeComparison(String value)
Construct a new TimeComparison with the specified value.
value
- the EnumeratedAttribute value.
compare
public static int compare(long t1,
long t2)
Compare two times.
t1
- the first time to compare.t2
- the second time to compare.
- a negative integer, a positive integer, or zero as t1 is
before, after, or equal to t2 accounting for the default granularity.
compare
public static int compare(long t1,
long t2,
long g)
Compare two times.
t1
- the first time to compare.t2
- the second time to compare.g
- the timestamp granularity.
- a negative integer, a positive integer, or zero as t1 is
before, after, or equal to t2 accounting for the specified granularity.
evaluate
public boolean evaluate(long t1,
long t2)
Evaluate two times against this TimeComparison.
t1
- the first time to compare.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)
Evaluate two times against this TimeComparison.
t1
- the first time to compare.t2
- the second time to compare.g
- the timestamp granularity.
- true if the comparison result fell within the parameters of this TimeComparison.
getValues
public String[] getValues()
Return the possible values.
- getValues in interface EnumeratedAttribute
- String[] of EnumeratedAttribute values.