Here you can find the source of hashCode(int previous, boolean x)
public static final int hashCode(int previous, boolean x)
//package com.java2s; //License from project: Apache License public class Main { private static final int PRIME = 1000003; public static final int hashCode(int previous, boolean x) { return (PRIME * previous) + (x ? 1 : 0); }// w w w. j a va 2 s. c o m public static final int hashCode(int previous, int x) { return (PRIME * previous) + x; } public static final int hashCode(int previous, long x) { // convert to two ints return (PRIME * previous) + (int) (PRIME * (x >>> 32) + (x & 0xFFFFFFFF)); } public static final int hashCode(int previous, float x) { return hashCode(previous, (x == 0.0F) ? 0 : Float.floatToIntBits(x)); } public static final int hashCode(int previous, double x) { // convert to long return hashCode(previous, (x == 0.0) ? 0L : Double.doubleToLongBits(x)); } public static final int hashCode(int previous, Object... x) { if (x == null) { return PRIME * previous; } int hc = previous; for (int i = 0; i < x.length; i++) { hc = (x[i] == null) ? (PRIME * hc) : (PRIME * hc) + x[i].hashCode(); } return hc; } }