// simple packed hashCode algorithm final int low1 = 0; final int high1 = 99; final int low2 = -10; final int high2 = 10; final int low3 = 100; final int high3 = 1000; int hashCode = ( field1 - low1 ); hashCode *= ( high2 - low2 + 1 ); hashCode += ( field2 - low2 ); hashCode *= ( high3 - low3 + 1 ); hashCode += ( field3 - low3 );