KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > collections > _AbstractOzoneMap_keySet


1 /*
2  * _AbstractOzoneMap_keySet.java
3  * $Id: _AbstractOzoneMap_keySet.java,v 1.4 2003/10/28 13:01:42 leomekenkamp Exp $
4  * This file is based on a part of AbstractMap.java from GNU Classpath. Quote:
5  
6 AbstractMap.java -- Abstract implementation of most of Map
7 Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
8  
9 This file is part of GNU Classpath.
10  
11 GNU Classpath is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
15  
16 GNU Classpath is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
20  
21 You should have received a copy of the GNU General Public License
22 along with GNU Classpath; see the file COPYING. If not, write to the
23 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24 02111-1307 USA.
25  
26 Linking this library statically or dynamically with other modules is
27 making a combined work based on this library. Thus, the terms and
28 conditions of the GNU General Public License cover the whole
29 combination.
30  
31 As a special exception, the copyright holders of this library give you
32 permission to link this library with independent modules to produce an
33 executable, regardless of the license terms of these independent
34 modules, and to copy and distribute the resulting executable under
35 terms of your choice, provided that you also meet, for each linked
36 independent module, the terms and conditions of the license of that
37 module. An independent module is a module which is not derived from
38 or based on this library. If you modify this library, you may extend
39 this exception to your version of the library, but you are not
40 obligated to do so. If you do not wish to do so, delete this
41 exception statement from your version.
42  
43  * end quote.
44  *
45  * This file is licenced under the same conditions as its original (GPL +
46  * "special exception").
47  */

48
49 package org.ozoneDB.collections;
50
51 import java.util.Iterator JavaDoc;
52
53 /**
54  * Do not use this class directly.
55  * This should be an inner class; unfortunately ozone does not support those yet.
56  */

57 class _AbstractOzoneMap_keySet extends AbstractOzoneSet implements OzoneSet {
58     
59     private OzoneMap owner;
60     
61     _AbstractOzoneMap_keySet(OzoneMap owner) {
62         this.owner = owner;
63     }
64     
65     public int size() {
66         return owner.size();
67     }
68     
69     public boolean contains(Object JavaDoc key) {
70         return owner.containsKey(key);
71     }
72     
73     public Iterator JavaDoc iterator() {
74         return new _AbstractOzoneMap_keySet_iterator(owner.entrySet().iterator());
75     }
76     
77     public Iterator JavaDoc _org_ozoneDB_internalIterator() {
78         return new _AbstractOzoneMap_keySet_iterator(((OzoneSet)owner.entrySet())._org_ozoneDB_internalIterator());
79     }
80     
81 };
82
Popular Tags