410 * is compared to any list or set. (By the same logic, it is not possible
411 * to write a class that correctly implements both the <tt>Set</tt> and
412 * <tt>List</tt> interfaces.)
413 *
414 * @param o object to be compared for equality with this collection
415 * @return <tt>true</tt> if the specified object is equal to this
416 * collection
417 *
418 * @see Object#equals(Object)
419 * @see Set#equals(Object)
420 * @see List#equals(Object)
421 */
422 boolean equals(Object o);
423
424 /**
425 * Returns the hash code value for this collection. While the
426 * <tt>Collection</tt> interface adds no stipulations to the general
427 * contract for the <tt>Object.hashCode</tt> method, programmers should
428 * take note that any class that overrides the <tt>Object.equals</tt>
429 * method must also override the <tt>Object.hashCode</tt> method in order
430 * to satisfy the general contract for the <tt>Object.hashCode</tt>method.
431 * In particular, <tt>c1.equals(c2)</tt> implies that
432 * <tt>c1.hashCode()==c2.hashCode()</tt>.
433 *
434 * @return the hash code value for this collection
435 *
436 * @see Object#hashCode()
437 * @see Object#equals(Object)
438 */
439 int hashCode();
440 }
|
410 * is compared to any list or set. (By the same logic, it is not possible
411 * to write a class that correctly implements both the <tt>Set</tt> and
412 * <tt>List</tt> interfaces.)
413 *
414 * @param o object to be compared for equality with this collection
415 * @return <tt>true</tt> if the specified object is equal to this
416 * collection
417 *
418 * @see Object#equals(Object)
419 * @see Set#equals(Object)
420 * @see List#equals(Object)
421 */
422 boolean equals(Object o);
423
424 /**
425 * Returns the hash code value for this collection. While the
426 * <tt>Collection</tt> interface adds no stipulations to the general
427 * contract for the <tt>Object.hashCode</tt> method, programmers should
428 * take note that any class that overrides the <tt>Object.equals</tt>
429 * method must also override the <tt>Object.hashCode</tt> method in order
430 * to satisfy the general contract for the <tt>Object.hashCode</tt> method.
431 * In particular, <tt>c1.equals(c2)</tt> implies that
432 * <tt>c1.hashCode()==c2.hashCode()</tt>.
433 *
434 * @return the hash code value for this collection
435 *
436 * @see Object#hashCode()
437 * @see Object#equals(Object)
438 */
439 int hashCode();
440 }
|