Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, wh
()
| 1529 | * @return a set view of the keys contained in this map. |
| 1530 | */ |
| 1531 | public Set keySet() |
| 1532 | { |
| 1533 | if (_key_set[ _KEY ] == null) |
| 1534 | { |
| 1535 | _key_set[ _KEY ] = new AbstractSet() |
| 1536 | { |
| 1537 | public Iterator iterator() |
| 1538 | { |
| 1539 | return new BinaryTreeIterator(_KEY) |
| 1540 | { |
| 1541 | protected Object doGetNext() |
| 1542 | { |
| 1543 | return _last_returned_node.getData(_KEY); |
| 1544 | } |
| 1545 | }; |
| 1546 | } |
| 1547 | |
| 1548 | public int size() |
| 1549 | { |
| 1550 | return BinaryTree.this.size(); |
| 1551 | } |
| 1552 | |
| 1553 | public boolean contains(Object o) |
| 1554 | { |
| 1555 | return containsKey(o); |
| 1556 | } |
| 1557 | |
| 1558 | public boolean remove(Object o) |
| 1559 | { |
| 1560 | int old_size = _size; |
| 1561 | |
| 1562 | BinaryTree.this.remove(o); |
| 1563 | return _size != old_size; |
| 1564 | } |
| 1565 | |
| 1566 | public void clear() |
| 1567 | { |
| 1568 | BinaryTree.this.clear(); |
| 1569 | } |
| 1570 | }; |
| 1571 | } |
| 1572 | return _key_set[ _KEY ]; |
| 1573 | } |
| 1574 | |
| 1575 | /** |
| 1576 | * Returns a collection view of the values contained in this |
no outgoing calls