Here you can find the source of calculateHash(Long... ids)
Calculate the hash code.
Parameter | Description |
---|---|
ids | the list of ids to be used. |
public static int calculateHash(Long... ids)
//package com.java2s; public class Main { /**/* www . ja v a 2s . c o m*/ * <p> * Calculate the hash code. * </p> * * @param ids * the list of ids to be used. * @return the calculated hash */ public static int calculateHash(Long... ids) { final int prime = 31; final int offset = 32; int result = 1; for (Long id : ids) { if (id != null) { result = prime * result + (int) (id ^ (id >>> offset)); } } return result; } }