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

Class HashvalueAlgorithm

public class HashvalueAlgorithm extends Object implements Algorithm

Computes a 'hashvalue' for the content of file using String.hashValue(). Use of this algorithm doesn't require any additional nested s and doesn't support any.

Since: Ant 1.6

Version: 2003-09-13

Method Summary
StringgetValue(File file)
Computes a 'hashvalue' for a file content.
booleanisValid()
This algorithm doesn't need any configuration.
StringtoString()
Override Object.toString().

Method Detail

getValue

public String getValue(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.

Parameters: file The file for which the value should be computed

Returns: the hashvalue or null if the file couldn't be read

isValid

public boolean isValid()
This algorithm doesn't need any configuration. Therefore it's always valid.

Returns: always true

toString

public String toString()
Override Object.toString().

Returns: information about this comparator