visad.data.in
Class MD5Key
- java.lang.Object
-
- visad.data.in.MD5Key
-
public class MD5Key extends java.lang.ObjectProvides support for computing an MD5 key for an object. Such a key may be used to obtain a hash code for an object and also supports implementation of a fastequals(Object)method for objects whose natural method might be computationally expensive.Instances are immutable.
-
-
Constructor Summary
Constructors Constructor and Description MD5Key(java.lang.Object obj)Constructs from an object.MD5Key(java.lang.Object[] objs)Constructs from an array of objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Indicates if this instance is semantically identical to another object.inthashCode()Returns the hash code of this instance.
-
-
-
Constructor Detail
-
MD5Key
public MD5Key(java.lang.Object obj) throws java.io.IOExceptionConstructs from an object.- Parameters:
obj- The object to have an MD5 checksum computed for it.- Throws:
java.io.IOException- Couldn't compute MD5 checksum.
-
MD5Key
public MD5Key(java.lang.Object[] objs) throws java.io.IOExceptionConstructs from an array of objects.- Parameters:
objs- The objects to have an MD5 checksum computed for them.- Throws:
java.io.IOException- Couldn't compute MD5 checksum.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Indicates if this instance is semantically identical to another object. This will be the case if the other object is also of this class and its MD5 checksum is identical to this instances MD5 checksum.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- The other object.- Returns:
trueif and only if this instance is semantically identical to the other object.
-
hashCode
public int hashCode()
Returns the hash code of this instance. The hash code is the hash code of the MD5 checksum.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code of this instance.
-
-
DMelt 3.0 © DataMelt by jWork.ORG