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

public Class TimeComparison

extends EnumeratedAttribute
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.types.selectors.DateSelector.TimeComparisons
Imports
org.apache.tools.ant.BuildException, org.apache.tools.ant.util.FileUtils

EnumeratedAttribute for time comparisons. Accepts values "before", "after", "equal".
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
public static final TimeComparison
AFTER

After Comparison.

public static final TimeComparison
BEFORE

Before Comparison.

public static final TimeComparison
EQUAL

Equal Comparison.

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

Constructor Summary

AccessConstructor and Description
public
TimeComparison()

Default constructor.

public
TimeComparison(String
the EnumeratedAttribute value.
value
)

Construct a new TimeComparison with the specified value.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

a negative integer, a positive integer, or zero as t1 is before, after, or equal to t2 accounting for the default granularity.
compare
(long
the first time to compare.
t1
,
long
the second time to compare.
t2
)

Compare two times.

public static int

Returns:

a negative integer, a positive integer, or zero as t1 is before, after, or equal to t2 accounting for the specified granularity.
compare
(long
the first time to compare.
t1
,
long
the second time to compare.
t2
,
long
the timestamp granularity.
g
)

Compare two times.

public boolean

Returns:

true if the comparison result fell within the parameters of this TimeComparison.
evaluate
(long
the first time to compare.
t1
,
long
the second time to compare.
t2
)

Evaluate two times against this TimeComparison.

public boolean

Returns:

true if the comparison result fell within the parameters of this TimeComparison.
evaluate
(long
the first time to compare.
t1
,
long
the second time to compare.
t2
,
long
the timestamp granularity.
g
)

Evaluate two times against this TimeComparison.

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

AFTERback to summary
public static final TimeComparison AFTER

After Comparison.

BEFOREback to summary
public static final TimeComparison BEFORE

Before Comparison.

EQUALback to summary
public static final TimeComparison EQUAL

Equal Comparison.

FILE_UTILSback to summary
private static final FileUtils FILE_UTILS
VALUESback to summary
private static final String[] VALUES

Constructor Detail

TimeComparisonback to summary
public TimeComparison()

Default constructor.

TimeComparisonback to summary
public TimeComparison(String value)

Construct a new TimeComparison with the specified value.

Parameters
value:String

the EnumeratedAttribute value.

Method Detail

compareback to summary
public static int compare(long t1, long t2)

Compare two times.

Parameters
t1:long

the first time to compare.

t2:long

the second time to compare.

Returns:int

a negative integer, a positive integer, or zero as t1 is before, after, or equal to t2 accounting for the default granularity.

compareback to summary
public static int compare(long t1, long t2, long g)

Compare two times.

Parameters
t1:long

the first time to compare.

t2:long

the second time to compare.

g:long

the timestamp granularity.

Returns:int

a negative integer, a positive integer, or zero as t1 is before, after, or equal to t2 accounting for the specified granularity.

evaluateback to summary
public boolean evaluate(long t1, long t2)

Evaluate two times against this TimeComparison.

Parameters
t1:long

the first time to compare.

t2:long

the second time to compare.

Returns:boolean

true if the comparison result fell within the parameters of this TimeComparison.

evaluateback to summary
public boolean evaluate(long t1, long t2, long g)

Evaluate two times against this TimeComparison.

Parameters
t1:long

the first time to compare.

t2:long

the second time to compare.

g:long

the timestamp granularity.

Returns:boolean

true if the comparison result fell within the parameters of this TimeComparison.

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.