1 /**
2 * Returns a hash code value for the object. This method is3 * supported for the benefit of hash tables such as those provided by4 * {@linkjava.util.HashMap}.5 *
6 * The general contract of {@codehashCode} is:7 *
- 8 *
- Whenever it is invoked on the same object more than once during9 * an execution of a Java application, the {@codehashCode} method10 * must consistently return the same integer, provided no information11 * used in {@codeequals} comparisons on the object is modified.12 * This integer need not remain consistent from one execution of an13 * application to another execution of the same application.14 *
- If two objects are equal according to the {@codeequals(Object)}15 * method, then calling the {@codehashCode} method on each of16 * the two objects must produce the same integer result.17 *
- It is not required that if two objects are unequal18 * according to the {@linkjava.lang.Object#equals(java.lang.Object)}19 * method, then calling the {@codehashCode} method on each of the20 * two objects must produce distinct integer results. However, the21 * programmer should be aware that producing distinct integer results22 * for unequal objects may improve the performance of hash tables.23 *
25 * As much as is reasonably practical, the hashCode method defined by26 * class {@codeObject} does return distinct integers for distinct27 * objects. (This is typically implemented by converting the internal28 * address of the object into an integer, but this implementation29 * technique is not required by the30 * Java™ programming language.)31 *32 *@returna hash code value for this object.33 *@seejava.lang.Object#equals(java.lang.Object)34 *@seejava.lang.System#identityHashCode35 */
36 public native int hashCode();