Whats an effective HashCode() for small x, large y values?
<p>I'm mapping x,y values onto a Cartesian plane with a HashMap. What would be an effective HashCode for very small x, very large y values?</p>

<p>currently I am using :</p>

<pre><code> public int hashCode() {
    return ((y * 31) ^ x);

 // &amp; Typical x,y values would be, (with many collisions on x):
  [4, 1000001] [9, 1000000] [5, 999996] [6, 999995] [4, 999997] 
  [6, 999997] [6, 1000003] [10, 999994] [8, 999997] [10, 999997] 
  [5, 999999] [4, 999998] [5, 1000003] [2, 1000005] [3, 1000004] 
  [6, 1000000] [3, 1000005]
</code></pre>

<p>I am inserting both x,y pairs into the key of a hashmap with a .put method, to avoid any duplicate x,y pairs. Not sure if that is the most effective solution either.</p>
