commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1180097 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java
Date Fri, 07 Oct 2011 16:44:18 GMT
Author: luc
Date: Fri Oct  7 16:44:18 2011
New Revision: 1180097

URL: http://svn.apache.org/viewvc?rev=1180097&view=rev
Log:
Added forgotten equals method for the hash table elements.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java?rev=1180097&r1=1180096&r2=1180097&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialsUtils.java
Fri Oct  7 16:44:18 2011
@@ -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);
+
+        }
     }
 
     /**



Mime
View raw message