01: /*
02: * Primitive Collections for Java.
03: * Copyright (C) 2002 Søren Bak
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
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;
22:
23: /**
24: * This class represents iterators over collections of char 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 CharIterator {
33:
34: /**
35: * Indicates whether more char values can be returned by this
36: * iterator.
37: *
38: * @return <tt>true</tt> if more char 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 char value of this iterator.
48: *
49: * @return the next char 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: char next();
58:
59: /**
60: * Removes the last char 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: }
|