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

## Class HashvalueAlgorithm

- java.lang.Object
- - org.apache.tools.ant.types.selectors.modifiedselector.HashvalueAlgorithm

- All Implemented Interfaces:
    Algorithm

      public class HashvalueAlgorithm
      extends java.lang.Object
      implements Algorithm

  Computes a 'hashvalue' for the content of file using String.hashValue(). Use of this algorithm doesn't require any additional nested <param>s and doesn't support any.
  Since:
    Ant 1.6
  Version:
    2003-09-13

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HashvalueAlgorithm()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getValue(java.io.File file)` Computes a 'hashvalue' for a file content.
    `boolean` | `isValid()` This algorithm doesn't need any configuration.
    `java.lang.String` | `toString()` Override Object.toString().

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

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

- - ### Constructor Detail

    - #### HashvalueAlgorithm

          public HashvalueAlgorithm()

  - ### Method Detail

    - #### 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 java.lang.String getValue(java.io.File file)

      Computes a 'hashvalue' for a file content. It reads the content of a file, convert that to String and use the String.hashCode() method.
      Specified by:
        `getValue` in interface `Algorithm`
      Parameters:
        `file` - The file for which the value should be computed
      Returns:
        the hashvalue or null if the file couldn't be read

    - #### toString

          public java.lang.String toString()

      Override Object.toString().
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        information about this comparator