Added forgotten equals method for the hash table elements.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1180097 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2011-10-07 16:44:18 +00:00
parent 461c45aa7d
commit 92743c883b
1 changed files with 14 additions and 0 deletions

View File

@ -277,6 +277,20 @@ public class PolynomialsUtils {
return (v << 16) ^ w;
}
/** Check if the instance represent the same key as another instance.
* @param key other key
* @return true if the instance and the other key refer to the same polynomial
*/
public boolean equals(final Object key) {
if ((key == null) || !(key instanceof JacobiKey)) {
return false;
}
final JacobiKey otherK = (JacobiKey) key;
return (v == otherK.v) && (w == otherK.w);
}
}
/**