net.sf.antcontrib.logic

Class TimestampSelector

public class TimestampSelector extends Task

Task definition for the foreach task. The foreach task iterates over a list, a list of filesets, or both.

 Usage:

   Task declaration in the project:
   
     <taskdef name="latesttimestamp" classname="net.sf.antcontrib.logic.TimestampSelector" />
   

   Call Syntax:
   
     <timestampselector
                 [property="prop" | outputsetref="id"]
                 [count="num"]
                 [age="eldest|youngest"]
                 [pathSep=","]
                 [pathref="ref"] >
       <path>
          ...
       </path>
     </latesttimestamp>
   

   Attributes:
         outputsetref --> The reference of the output Path set which will contain the
                          files with the latest timestamps.
         property  --> The name of the property to set with file having the latest
                       timestamp.  If you specify the "count" attribute, you will get
                       the lastest N files.  These will be the absolute pathnames
         count     --> How many of the latest files do you wish to find
         pathSep   --> What to use as the path separator when using the "property"
                       attribute, in conjunction with the "count" attribute
         pathref   --> The reference of the path which is the input set of files.

 

Author: Matthew Inger

Constructor Summary
TimestampSelector()
Default Constructor
Method Summary
protected intcompare(File a, File b)
PathcreatePath()
voiddoFileSetExecute(String[] paths)
voidexecute()
protected intpartition(Vector array, int start, int end)
voidsetAge(String age)
voidsetCount(int count)
voidsetOutputSetId(String outputSetId)
voidsetPathRef(Reference ref)
voidsetPathSep(char pathSep)
voidsetProperty(String property)
voidsort(Vector array)
protected voidsort(Vector array, int start, int end)
protected voidswap(Vector array, int i, int j)

Constructor Detail

TimestampSelector

public TimestampSelector()
Default Constructor

Method Detail

compare

protected int compare(File a, File b)

createPath

public Path createPath()

doFileSetExecute

public void doFileSetExecute(String[] paths)

execute

public void execute()

partition

protected int partition(Vector array, int start, int end)

setAge

public void setAge(String age)

setCount

public void setCount(int count)

setOutputSetId

public void setOutputSetId(String outputSetId)

setPathRef

public void setPathRef(Reference ref)

setPathSep

public void setPathSep(char pathSep)

setProperty

public void setProperty(String property)

sort

public void sort(Vector array)

sort

protected void sort(Vector array, int start, int end)

swap

protected void swap(Vector array, int i, int j)