KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > bak > pcj > ShortIterator


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;
20
21 import java.util.NoSuchElementException JavaDoc;
22
23 /**
24  * This class represents iterators over collections of short values.
25  *
26  * @see java.util.Iterator
27  *
28  * @author Søren Bak
29  * @version 1.0 2002/29/12
30  * @since 1.0
31  */

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

44     boolean hasNext();
45
46     /**
47      * Returns the next short value of this iterator.
48      *
49      * @return the next short value of this iterator.
50      *
51      * @throws NoSuchElementException
52      * if no more elements are available from this
53      * iterator.
54      *
55      * @see #hasNext()
56      */

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

70     void remove();
71
72 }
Popular Tags