| 490 | /// |
| 491 | /// - #hashCode |
| 492 | @Override |
| 493 | public boolean equals(Object object) { |
| 494 | if (this == object) { |
| 495 | return true; |
| 496 | } |
| 497 | if (object instanceof List) { |
| 498 | List<?> list = (List<?>) object; |
| 499 | if (list.size() != size()) { |
| 500 | return false; |
| 501 | } |
| 502 | |
| 503 | Iterator<?> it1 = iterator(), it2 = list.iterator(); |
| 504 | while (it1.hasNext()) { |
| 505 | Object e1 = it1.next(), e2 = it2.next(); |
| 506 | if (!(e1 == null ? e2 == null : e1.equals(e2))) { |
| 507 | return false; |
| 508 | } |
| 509 | } |
| 510 | return true; |
| 511 | } |
| 512 | return false; |
| 513 | } |
| 514 | |
| 515 | /// Returns the element at the specified location in this list. |
| 516 | /// |