Class Date
- java.lang.Object
- 
- org.apache.tools.ant.types.resources.selectors.Date
 
- 
- All Implemented Interfaces:
- ResourceSelector
 
 public class Date extends java.lang.Object implements ResourceSelector 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.- Since:
- Ant 1.7
 
- 
- 
Constructor SummaryConstructors Constructor Description Date()
 - 
Method SummaryModifier and Type Method Description java.lang.StringgetDatetime()Get the date and time in String format.longgetGranularity()Get the timestamp granularity used by this ResourceSelector.longgetMillis()Get the date/time in ms.java.lang.StringgetPattern()Get the pattern for use with the datetime attribute.TimeComparisongetWhen()Get the comparison mode.booleanisSelected(Resource r)Return true if this Resource is selected.voidsetDateTime(java.lang.String s)Set the date and time as a String.voidsetGranularity(long g)Set the granularity to use for this ResourceSelector.voidsetMillis(long m)Set the date/time in milliseconds since 1970.voidsetPattern(java.lang.String p)Set the optional pattern to use with the datetime attribute.voidsetWhen(TimeComparison c)Set the comparison mode.
 
- 
- 
- 
Method Detail- 
setMillispublic void setMillis(long m) Set the date/time in milliseconds since 1970.- Parameters:
- m- the number of millis.
 
 - 
getMillispublic long getMillis() Get the date/time in ms.- Returns:
- long number of millis since 1970.
 
 - 
setDateTimepublic void setDateTime(java.lang.String s) Set the date and time as a String.- Parameters:
- s- the date and time to use.
 
 - 
getDatetimepublic java.lang.String getDatetime() Get the date and time in String format.- Returns:
- a String representing a date and time.
 
 - 
setGranularitypublic void setGranularity(long g) Set the granularity to use for this ResourceSelector.- Parameters:
- g- the timestamp granularity.
 
 - 
getGranularitypublic long getGranularity() Get the timestamp granularity used by this ResourceSelector.- Returns:
- the long granularity.
 
 - 
setPatternpublic void setPattern(java.lang.String p) Set the optional pattern to use with the datetime attribute.- Parameters:
- p- the SimpleDateFormat-compatible pattern string.
 
 - 
getPatternpublic java.lang.String getPattern() Get the pattern for use with the datetime attribute.- Returns:
- a SimpleDateFormat-compatible pattern string.
 
 - 
setWhenpublic void setWhen(TimeComparison c) Set the comparison mode.- Parameters:
- c- a TimeComparison object.
 
 - 
getWhenpublic TimeComparison getWhen() Get the comparison mode.- Returns:
- a TimeComparison object.
 
 - 
isSelectedpublic boolean isSelected(Resource r) Return true if this Resource is selected.- Specified by:
- isSelectedin interface- ResourceSelector
- Parameters:
- r- the Resource to check.
- Returns:
- whether the Resource was selected.
 
 
- 
 
-