LastModifiedAlgorithm (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.types.selectors.modifiedselector, class: LastModifiedAlgorithm

Package org.apache.tools.ant.types.selectors.modifiedselector

# Class LastModifiedAlgorithm

java.lang.Object
org.apache.tools.ant.types.selectors.modifiedselector.LastModifiedAlgorithm

All Implemented Interfaces:
  `Algorithm`

public class LastModifiedAlgorithm extends Object implements Algorithm
Computes a 'timestamp' of file based on the lastModified time of that file.

Since:
  Ant 1.10.6 and 1.9.14
Version:
  2018-07-25

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LastModifiedAlgorithm()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getValue​(File file)`
  Computes a 'timestamp' for a file based on the lastModified time.
  `boolean`
  `isValid()`
  This algorithm doesn't need any configuration.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LastModifiedAlgorithm

    public LastModifiedAlgorithm()

- ## Method Details

  - ### isValid

    public boolean isValid()
    This algorithm doesn't need any configuration. Therefore it's always valid.
    Specified by:
      `isValid` in interface `Algorithm`
    Returns:
      always true

  - ### getValue

    public String getValue​(File file)
    Computes a 'timestamp' for a file based on the lastModified time.
    Specified by:
      `getValue` in interface `Algorithm`
    Parameters:
      `file` - The file for which the value should be computed
    Returns:
      the timestamp or null if the timestamp couldn't be computed