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

Class HashvalueAlgorithm

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
Version:
2003-09-13
Since:
Ant 1.6

Method Summary

String
getValue(File file)
Computes a 'hashvalue' for a file content.
boolean
isValid()
This algorithm doesn't need any configuration.
String
toString()
Override Object.toString().

Method Details

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.
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

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

toString

public String toString()
Override Object.toString().
Returns:
information about this comparator