-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIteratorMe.java
More file actions
46 lines (43 loc) · 1.38 KB
/
IteratorMe.java
File metadata and controls
46 lines (43 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package resourceCode.util;
import java.util.NoSuchElementException;
/**
* Iterator½Ó¿Ú
*
* @author ken
* @param <E>
* 2017-4-1 ÉÏÎç10:20:38
*/
public interface IteratorMe<E> {
/**
* Returns true if the iteration has more elements. (In other words, returns
* true if next would return an element rather than throwing an exception.)
*
* @return true if the iterator has more elements.
*/
boolean hasNext();
/**
* Returns the next element in the iteration.
*
* @return the next element in the iteration.
* @exception NoSuchElementException
* iteration has no more elements.
*/
E next();
/**
*
* Removes from the underlying collection the last element returned by the
* iterator (optional operation).
* This method can be called only once per call to next.
* The behavior of an iterator is unspecified if the
* underlying collection is modified while the iteration is in progress in
* any way other than by calling this method.
*
* @exception UnsupportedOperationException
* if the remove operation is not supported by this Iterator.
* @exception IllegalStateException
* if the next method has not yet been called, or
* the remove method has already been called after
* the last call to the next method.
*/
void remove();
}