Here you can find the source of hashCode(long value)
Parameter | Description |
---|---|
value | A long integer value. |
public static int hashCode(long value)
//package com.java2s; /*//from w w w . j av a2s .co m * Copyright (c) 2015 NEC Corporation * All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html */ public class Main { /** * Return a hash code of the given long integer value. * * @param value A long integer value. * @return A hash code of the given value. */ public static int hashCode(long value) { return (int) (value ^ (value >>> Integer.SIZE)); } /** * Return a hash code of the given double value. * * @param value A double value. * @return A hash code of the given value. */ public static int hashCode(double value) { return hashCode(Double.doubleToLongBits(value)); } }