KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > bak > pcj > map > BooleanKeyBooleanMapIterator


1 /*
2  * Primitive Collections for Java.
3  * Copyright (C) 2002 Søren Bak
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 package bak.pcj.map;
20
21 /**
22  * This interface represents iterators over maps from
23  * boolean values to boolean values.
24  *
25  * @see bak.pcj.map.BooleanKeyBooleanMap
26  * @see bak.pcj.BooleanIterator
27  *
28  * @author Søren Bak
29  * @version 1.0 2002/29/12
30  * @since 1.0
31  */

32 public interface BooleanKeyBooleanMapIterator {
33
34     /**
35      * Indicates whether more entries can be returned by this
36      * iterator.
37      *
38      * @return <tt>true</tt> if more boolean entries can be returned
39      * by this iterator; returns <tt>false</tt>
40      * otherwise.
41      *
42      * @see #next()
43      */

44     boolean hasNext();
45
46     /**
47      * Advances to the next entry of this iterator.
48      *
49      * @throws java.util.NoSuchElementException
50      * if no more entries are available from this
51      * iterator.
52      *
53      * @see #hasNext()
54      */

55     void next();
56
57     /**
58      * Removes the last entry value returned from the underlying
59      * map.
60      *
61      * @throws UnsupportedOperationException
62      * if removal is not supported by this iterator.
63      *
64      * @throws IllegalStateException
65      * if no entry has been returned by this iterator
66      * yet.
67      */

68     void remove();
69
70     /**
71      * Returns the key of the current entry of this iterator.
72      *
73      * @return the key of the current entry of this iterator.
74      *
75      * @throws IllegalStateException
76      * if there is no current entry (i.e. if
77      * {@link #next() next()}
78      * has not been called or
79      * {@link #remove() remove()}
80      * has just been called.
81      *
82      * @see #getValue()
83      */

84     boolean getKey();
85
86     /**
87      * Returns the value of the current entry of this iterator.
88      *
89      * @return the value of the current entry of this iterator.
90      *
91      * @throws IllegalStateException
92      * if there is no current entry (i.e. if
93      * {@link #next() next()}
94      * has not been called or
95      * {@link #remove() remove()}
96      * has just been called.
97      *
98      * @see #getKey()
99      */

100     boolean getValue();
101
102 }
Popular Tags