Returns an enumeration on the keys of this Hashtable instance. The results of the enumeration may be affected if the contents of this Hashtable are modified. @return an enumeration of the keys of this Hashtable. @see #elements @see #size @see Enumeration
()
| 537 | * @see Enumeration |
| 538 | */ |
| 539 | @Override |
| 540 | @SuppressWarnings("unchecked") |
| 541 | public synchronized java.util.Enumeration<K> keys() { |
| 542 | if (elementCount == 0) { |
| 543 | return (java.util.Enumeration<K>) EMPTY_ENUMERATION; |
| 544 | } |
| 545 | return new HashEnumIterator<K>(new MapEntry.Type<K, K, V>() { |
| 546 | public K get(MapEntry<K, V> entry) { |
| 547 | return entry.key; |
| 548 | } |
| 549 | }, true); |
| 550 | } |
| 551 | |
| 552 | /** |
| 553 | * Returns a set of the keys contained in this {@code Hashtable}. The set |
no outgoing calls