Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress, the results of the iteration are undefined. The col
()
| 1586 | * @return a collection view of the values contained in this map. |
| 1587 | */ |
| 1588 | public Collection values() |
| 1589 | { |
| 1590 | if (_value_collection[ _KEY ] == null) |
| 1591 | { |
| 1592 | _value_collection[ _KEY ] = new AbstractCollection() |
| 1593 | { |
| 1594 | public Iterator iterator() |
| 1595 | { |
| 1596 | return new BinaryTreeIterator(_KEY) |
| 1597 | { |
| 1598 | protected Object doGetNext() |
| 1599 | { |
| 1600 | return _last_returned_node.getData(_VALUE); |
| 1601 | } |
| 1602 | }; |
| 1603 | } |
| 1604 | |
| 1605 | public int size() |
| 1606 | { |
| 1607 | return BinaryTree.this.size(); |
| 1608 | } |
| 1609 | |
| 1610 | public boolean contains(Object o) |
| 1611 | { |
| 1612 | return containsValue(o); |
| 1613 | } |
| 1614 | |
| 1615 | public boolean remove(Object o) |
| 1616 | { |
| 1617 | int old_size = _size; |
| 1618 | |
| 1619 | removeValue(o); |
| 1620 | return _size != old_size; |
| 1621 | } |
| 1622 | |
| 1623 | public boolean removeAll(Collection c) |
| 1624 | { |
| 1625 | boolean modified = false; |
| 1626 | Iterator iter = c.iterator(); |
| 1627 | |
| 1628 | while (iter.hasNext()) |
| 1629 | { |
| 1630 | if (removeValue(iter.next()) != null) |
| 1631 | { |
| 1632 | modified = true; |
| 1633 | } |
| 1634 | } |
| 1635 | return modified; |
| 1636 | } |
| 1637 | |
| 1638 | public void clear() |
| 1639 | { |
| 1640 | BinaryTree.this.clear(); |
| 1641 | } |
| 1642 | }; |
| 1643 | } |
| 1644 | return _value_collection[ _KEY ]; |
| 1645 | } |
no outgoing calls