Java Hash Code Calculate hashCode(final int x, final int y)

Here you can find the source of hashCode(final int x, final int y)

Description

Returns an integer hash code for a point.

License

Open Source License

Return

an integer hash code for a point

Declaration

public static int hashCode(final int x, final int y) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from ww w.ja va 2  s .c o  m
     * Returns an integer hash code for a point.
     *
     * @return an integer hash code for a point
     */
    public static int hashCode(final int x, final int y) {
        final int hashX = ((Integer) x).hashCode();
        final int hashY = ((Integer) y).hashCode();
        return 31 * hashX + hashY;
    }
}

Related

  1. hashCode(final byte[] data)
  2. hashCode(final char[] text, final int textOffset, final int textLen)
  3. hashCode(final int i)
  4. hashCode(final int i)
  5. hashCode(final int seed, final int hashcode)
  6. hashcode(final int[] array)
  7. hashCode(final long l)
  8. hashCode(final long l)
  9. hashCode(final long v)