org.apache.tools.ant.types.resources.selectors
Class Date
java.lang.Object
org.apache.tools.ant.types.resources.selectors.Date
- ResourceSelector
public class Date
extends java.lang.Object
Date ResourceSelector. Based on the date FileSelector, with the most
notable difference being the lack of support for the includedirs attribute.
It is recommended that the effect of includeDirs = "false" be achieved for
resources by enclosing a "dir" Type ResourceSelector and a Date
ResourceSelector in an Or ResourceSelector.
getDatetime
public String getDatetime()
Get the date & time in String format.
- a String representing a date & time.
getGranularity
public long getGranularity()
Get the timestamp granularity used by this ResourceSelector.
getMillis
public long getMillis()
Get the date/time in ms.
- long number of millis since 1970.
getPattern
public String getPattern()
Get the pattern for use with the datetime attribute.
- a SimpleDateFormat-compatible pattern string.
isSelected
public boolean isSelected(Resource r)
Return true if this Resource is selected.
- isSelected in interface ResourceSelector
r
- the Resource to check.
- whether the Resource was selected.
setDateTime
public void setDateTime(String s)
Set the date and time as a String.
s
- the date & time to use.
setGranularity
public void setGranularity(long g)
Set the granularity to use for this ResourceSelector.
g
- the timestamp granularity.
setMillis
public void setMillis(long m)
Set the date/time in milliseconds since 1970.
m
- the number of millis.
setPattern
public void setPattern(String p)
Set the optional pattern to use with the datetime attribute.
p
- the SimpleDateFormat-compatible pattern string.
setWhen
public void setWhen(TimeComparison c)
Set the comparison mode.
c
- a TimeComparison object.