| 406 | /// |
| 407 | /// - #hashCode |
| 408 | @Override |
| 409 | public synchronized boolean equals(Object object) { |
| 410 | if (this == object) { |
| 411 | return true; |
| 412 | } |
| 413 | if (object instanceof List) { |
| 414 | List<?> list = (List<?>) object; |
| 415 | if (list.size() != elementCount) { |
| 416 | return false; |
| 417 | } |
| 418 | |
| 419 | int index = 0; |
| 420 | Iterator<?> it = list.iterator(); |
| 421 | while (it.hasNext()) { |
| 422 | Object e1 = elementData[index++], e2 = it.next(); |
| 423 | if (!(e1 == null ? e2 == null : e1.equals(e2))) { |
| 424 | return false; |
| 425 | } |
| 426 | } |
| 427 | return true; |
| 428 | } |
| 429 | return false; |
| 430 | } |
| 431 | |
| 432 | /// Returns the first element in this vector. |
| 433 | /// |