Return to Snippet

Revision: 45173
at April 26, 2011 22:31 by intoxicadocoder


Initial Code
int hashCode = 0;

	@Override
	public int hashCode() {
		if (this.hashCode == 0) {
			return genericHash(this.id_otro_responsable,getId_persona());
		}
		return id_otro_responsable;
	}

	public static int genericHash(int... fieldHashes) {
		int result = 17;
		for (int hash : fieldHashes) {
			result = 37 * result + hash;
		}
		return result;
	}

Initial URL

                                

Initial Description
metodo para generar hashcodes

Initial Title
El metodo hashCode

Initial Tags
java

Initial Language
Java