| 346 | } |
| 347 | |
| 348 | public Set keySet(){ |
| 349 | return new AbstractSet(){ |
| 350 | |
| 351 | public Iterator iterator(){ |
| 352 | final Iterator mi = APersistentMap.this.iterator(); |
| 353 | |
| 354 | return new Iterator(){ |
| 355 | |
| 356 | |
| 357 | public boolean hasNext(){ |
| 358 | return mi.hasNext(); |
| 359 | } |
| 360 | |
| 361 | public Object next(){ |
| 362 | Entry e = (Entry) mi.next(); |
| 363 | return e.getKey(); |
| 364 | } |
| 365 | |
| 366 | public void remove(){ |
| 367 | throw new UnsupportedOperationException(); |
| 368 | } |
| 369 | }; |
| 370 | } |
| 371 | |
| 372 | public int size(){ |
| 373 | return count(); |
| 374 | } |
| 375 | |
| 376 | public boolean contains(Object o){ |
| 377 | return APersistentMap.this.containsKey(o); |
| 378 | } |
| 379 | }; |
| 380 | } |
| 381 | |
| 382 | public Object put(Object key, Object value){ |
| 383 | throw new UnsupportedOperationException(); |